RE: [Zope] Apache virtual host combined with Zope
I don't know about FastCGI, but mod_pcgi2 can handle entire tree (Zope serves root of a virtual host) or subtree (Zope serves subdirectory of a site) without any special hacks.
Yeah, so can ProxyPass.
What exactly is your problem?
Well, I just don't know how it's done. I must confess that I haven't investigated this too far, maybe with some reading about the syntax of Apache's FastCGI directive I could find the answer. To use FastCGI to serve a virtual, I'd have the vitual defined in my httpd.conf something like this: <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. Which is fine if that's what you want, but not if you want to serve subtrees. 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. ;-) -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.
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. There is certainly a parameter for this, but I don't know it. What is /usr/local/apache/htdocs/foo? 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.
On Fri, 6 Apr 2001, Oleg Broytmann wrote:
Ah, so your problem is different from what I though. I thought you want to serve some dirs from Apache, and some from Zope.
Oleg, What you're talking about *is* what I want to do. But i haven't been able to figure out for sure what I need to do. Let me give you an example... On Debian, my root for html document is /var/www. I can use a virtual host entry in my apache config and ProxyPass to direct all requests for spam.org to spam.org:8080. No problem there. Let's say, however, that I have a /var/www/eggs directory that I would like served by apache. Can ProxyPass do that by itself. In other words, www.spam.org should come from Zope at spam.org:8080 www.spam.org/eggs should come from Apache (/var/www/eggs) Do I need a Rewrite rule? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ wilson@visi.com | <dtml-var pithy_quote> | http://linux.com/
On Fri, 6 Apr 2001, Timothy Wilson wrote:
On Fri, 6 Apr 2001, Oleg Broytmann wrote:
Ah, so your problem is different from what I though. I thought you want to serve some dirs from Apache, and some from Zope.
Oleg,
What you're talking about *is* what I want to do. But i haven't been able to figure out for sure what I need to do. Let me give you an example...
On Debian, my root for html document is /var/www. I can use a virtual host entry in my apache config and ProxyPass to direct all requests for spam.org to spam.org:8080. No problem there. Let's say, however, that I have a /var/www/eggs directory that I would like served by apache. Can ProxyPass do that by itself.
In other words,
www.spam.org should come from Zope at spam.org:8080 www.spam.org/eggs should come from Apache (/var/www/eggs)
Do I need a Rewrite rule?
No. Use <Location> inside your <VirtualServer>: <Location /egg> ProxyPass ... </Location> Thus some parts of the virtual server will be served from as usual, and some (started with /egg) will be served by different rules. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
A related question; what if I want two virtual hosts... www.hostone.com and www.hosttwo.org And in my zope installation I want to have this sort of folder organisation: root| |->hostone |->hosttwo and I want zope to serve www.hostone.com from hostone and www.hosttwo.org from hosttwo. I tried a proxy pass for www.hostone.com to http://my.ip.he.re:8080/ and another for www.hosttwo.org to http://my.ip.he.re:8080/ and two site roots in my zope installation; In hostone: baseurl=http://www.hostone.com path=/ In hosttwo baseurl=http://www.hosttwo.org path=/ The problem is that when I did that, I could not get to any management screen; in short my zope just died and I had to reinstall; How should I have gone about this? Thanks. On Fri, 6 Apr 2001, Oleg Broytmann wrote:
On Fri, 6 Apr 2001, Timothy Wilson wrote:
On Fri, 6 Apr 2001, Oleg Broytmann wrote:
Ah, so your problem is different from what I though. I thought you want to serve some dirs from Apache, and some from Zope.
Oleg,
What you're talking about *is* what I want to do. But i haven't been able to figure out for sure what I need to do. Let me give you an example...
On Debian, my root for html document is /var/www. I can use a virtual host entry in my apache config and ProxyPass to direct all requests for spam.org to spam.org:8080. No problem there. Let's say, however, that I have a /var/www/eggs directory that I would like served by apache. Can ProxyPass do that by itself.
In other words,
www.spam.org should come from Zope at spam.org:8080 www.spam.org/eggs should come from Apache (/var/www/eggs)
Do I need a Rewrite rule?
No. Use <Location> inside your <VirtualServer>:
<Location /egg> ProxyPass ... </Location>
Thus some parts of the virtual server will be served from as usual, and some (started with /egg) will be served by different rules.
Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi! I cannot help you with ProxyPass - I use mod_pcgi2. With this module the task is easy. I heard it is a litle bit less easy with mod_fastcgi, but still solvable. On Sat, 7 Apr 2001 patrick@spice.eahd.or.ug wrote:
A related question; what if I want two virtual hosts... www.hostone.com and www.hosttwo.org
And in my zope installation I want to have this sort of folder organisation:
root| |->hostone |->hosttwo
and I want zope to serve www.hostone.com from hostone and www.hosttwo.org from hosttwo.
I tried a proxy pass for www.hostone.com to http://my.ip.he.re:8080/ and another for www.hosttwo.org to http://my.ip.he.re:8080/ and two site roots in my zope installation; In hostone: baseurl=http://www.hostone.com path=/ In hosttwo baseurl=http://www.hosttwo.org path=/ The problem is that when I did that, I could not get to any management screen; in short my zope just died and I had to reinstall; How should I have gone about this?
Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
It's actually quite easy with FastCGI. See my posting from a couple days ago under this thread for an example. Maybe I'll write a How-To after all. I have several domains setup this way. Both serving and management under each domain work flawlessly. _______________________ Ron Bickers Logic Etc, Inc. rbickers@logicetc.com
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Oleg Broytmann Sent: Saturday, April 07, 2001 8:20 AM To: patrick@spice.eahd.or.ug Cc: 'zope@zope.org' Subject: RE: [Zope] Apache virtual host combined with Zope
Hi!
I cannot help you with ProxyPass - I use mod_pcgi2. With this module the task is easy. I heard it is a litle bit less easy with mod_fastcgi, but still solvable.
On Sat, 7 Apr 2001 patrick@spice.eahd.or.ug wrote:
A related question; what if I want two virtual hosts... www.hostone.com and www.hosttwo.org
And in my zope installation I want to have this sort of folder organisation:
root| |->hostone |->hosttwo
Setup a Virtual Host for your local Apache folder and run it on a different port. Then you can proxy pass that port to the /eggs folder The VH below will setup your Apache non-passed site on port 1080 <VirtualHost 1.2.3.4:1080> ServerAdmin support@spam.org DocumentRoot /spam.org/root/www ServerName spam.org <Directory "/spam.org/root/www"> Options Indexes FollowSymLinks MultiViews Includes ExecCGI AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> This VH will target your /eggs folder to the above VH so you can serve folders with apache <VirtualHost 1.2.3.4> ServerAdmin support@spam.org DocumentRoot /spam.org/root/www ServerName spam.org ProxyPass / http://spam.org:8080/ ProxyPassReverse / http://spam.org:8080/ ProxyPass /misc_ http://spam.org:8080/misc_ ProxyPass /p_ http://spam.org:8080/p_ ProxyPass /eggs http://spam.org:1080/ # this is your port for VH to apache root ProxyPassReverse /eggs http://spam.org:1080/ </VirtualHost> I have done proxypass with sub-directories pointing to other servers all together but not back to a VH from the same apache server. But it should work. Give it a try Sherwood At 11:12 AM 4/6/2001 -0500, Timothy Wilson wrote:
On Fri, 6 Apr 2001, Oleg Broytmann wrote:
Ah, so your problem is different from what I though. I thought you want to serve some dirs from Apache, and some from Zope.
Oleg,
What you're talking about *is* what I want to do. But i haven't been able to figure out for sure what I need to do. Let me give you an example...
On Debian, my root for html document is /var/www. I can use a virtual host entry in my apache config and ProxyPass to direct all requests for spam.org to spam.org:8080. No problem there. Let's say, however, that I have a /var/www/eggs directory that I would like served by apache. Can ProxyPass do that by itself.
In other words,
www.spam.org should come from Zope at spam.org:8080 www.spam.org/eggs should come from Apache (/var/www/eggs)
Do I need a Rewrite rule?
-Tim
-- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ wilson@visi.com | <dtml-var pithy_quote> | http://linux.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi,
www.spam.org should come from Zope at spam.org:8080 www.spam.org/eggs should come from Apache (/var/www/eggs)
I would solve this problme with an "Alias": <virtualhost 123.234.123.123> ServerName www.spam.org DocumentRoot /your/doc/root ...... Alias /eggs/ /var/www/eggs/ ProxyPass / http://www.spam.org:8080/ ProxyPassReverse / http://www.spam.org:8080/ </virtualhost> it works for me ... Robert
participants (7)
-
Andy Gimblett -
Oleg Broytmann -
patrick@spice.eahd.or.ug -
Robert Wohlfahrt -
Ron Bickers -
Sherwood Robinson -
Timothy Wilson