[Zope] Apache virtual host combined with Zope

Andy Gimblett andy.gimblett@ftech.net
Fri, 6 Apr 2001 16:26:08 +0100


> Ah, so your problem is different from what I though. I 
> thought you want to serve some dirs from Apache, and
> some from Zope. But you want server entire server from
> Zope, but not from root of ZODB.

You've got it - that's exactly what I want.

> There is certainly a parameter for this, but I don't know it.
> What is /usr/local/apache/htdocs/foo?

It's a dummy file, but I don't know why/if it's needed. I
think it's time to play "hunt the docs". :-)

OK, this looks good:
http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html

Let's see...

<VirtualHost 1.2.3.4>
    ServerAdmin gimbo@ftech.net
    ServerName foo.bar.com
    ErrorLog logs/foo_error.log
    CustomLog logs/foo_access.log common
    FastCgiExternalServer /usr/local/apache/htdocs/foo \
                          -host localhost:8889 \
                          -pass-header Authorization
    SetHandler fastcgi-script
</VirtualHost>

OK, so "SetHandler fascgi-script" tells Apache to handle
all files (within the scope of this directive) as FastCGI
applications... Fair enough.

>From that doc: "The FastCgiExternalServer directive defines
_filename_ as an external FastCGI application. If filename
does not begin with a slash (/) then it is assumed to be
relative to the ServerRoot.  The filename does not have to
exist in the local filesystem.  URIs that Apache resolves
to this filename will be handled by this external FastCGI
application... External FastCGI applications are not started
by the process manager, they are presumed to be started and
managed "external" to Apache and mod_fastcgi. "

So my dummy doesn't (apparently) need to exist. Interesting.

Hmmm, but no, FastCGIExternalServer *doesn't* appear to have
any directive to point to a "subdirectory" in the external
server. None of the other directives seem to be appropriate
either.

Possible solutions:

1. Use a rewrite rule. Eurgh, I hate these. :-)
2. Get Zope to listen out for FastCGI on multiple ports, one
   for each virtual. Seems like overkill!

Hmmm, think I'll stick with ProxyPass. ;-)

Ah well, at least now I've looked into this!

Cheers,

-Andy

-- 
Andy Gimblett <andy.gimblett@ftech.net> Programmer 
Frontier Internet Services Limited <www.frontier-internet.ltd.uk> 
Tel: 029 20 820 044 Fax: 029 20 820 035 
Statements made are at all times subject to Frontier's Terms and
Conditions of Business, which are available upon request.


> -----Original Message-----
> From: Oleg Broytmann [mailto:phd@phd.fep.ru]
> Sent: 06 April 2001 15:58
> To: Andy Gimblett
> Cc: 'zope@zope.org'
> Subject: RE: [Zope] Apache virtual host combined with Zope
> 
> 
> 
> On Fri, 6 Apr 2001, Andy Gimblett wrote:
> > <VirtualHost 1.2.3.4>
> >     ServerAdmin gimbo@ftech.net
> >     ServerName foo.bar.com
> >     ErrorLog logs/foo_error.log
> >     CustomLog logs/foo_access.log common
> >
> >     FastCgiExternalServer /usr/local/apache/htdocs/foo \
> >                           -host localhost:8889 \
> >                           -pass-header Authorization
> >     SetHandler fastcgi-script
> > </VirtualHost>
> >
> > Looking at that, I can't see any way to tell it to pass the
> > request to a subdirectory of the Zope tree being served up by
> > the ZServer listening on 8889. So the effect is that foo.bar.com
> > is a virtual for the entire Zope tree instead.
> >
> > As I say, maybe there's another parameter to FastCgiExternalServer
> > which does it, but I haven't found it. I haven't looked too hard,
> > either, mind. ;-)
> 
> Oleg.
> ----
>      Oleg Broytmann     http://www.zope.org/Members/phd/     
> phd@phd.pp.ru
>            Programmers don't die, they just GOSUB without RETURN.
>