Re: [Zope] Multiple Sites and Apache
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ? BTW -- I am running the latest stable Zope (2.3.3 ?) on FreeBSD 4.3-STABLE via the port and it uses Python 2.0. My current httpd.conf file has to following Zope related configuration: RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] <Directory /usr/local/www/cgi-bin.default> Options +ExecCGI </Directory> Tom Veldhouse veldy@veldy.net
"TTV" == Thomas T Veldhouse <veldy@veldy.net> writes:
>> Why not ProxyPass + SiteRoot? 2 different ProxyPass >> statements, and a corresponding SiteRoot object in each >> subdirectory? TTV> I am not familiar with ProxyPass. However, I did try TTV> SiteRoot and whatever it did, it caused the Zope management TTV> interface to become unaccessable (both >> From Apache and 8080). Hmm ? TTV> BTW -- I am running the latest stable Zope (2.3.3 ?) on TTV> FreeBSD 4.3-STABLE via the port and it uses Python 2.0. My TTV> current httpd.conf file has to following Zope related TTV> configuration: There's a HOWTO (or used to be) on zope.org, but I'm doing something like: ProxyPass / http://gyrfalcon.fhcrc.org:9673/ ProxyPassReverse / http://gyrfalcon.fhcrc.org:9673/ ProxyPass /misc_ http://gyrfalcon.fhcrc.org:9673/misc_ ProxyPass /p_ http://gyrfalcon.fhcrc.org:9673/p_ and I'm sure you could change the "/" to something more appropriate, as well as the "eventual" location. -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini@u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini@scharp.org -------- (wednesday/friday is unknown) -------- FHCRC: M-Tu : 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: Th : 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
There's a HOWTO (or used to be) on zope.org, but I'm doing something like:
ProxyPass / http://gyrfalcon.fhcrc.org:9673/ ProxyPassReverse / http://gyrfalcon.fhcrc.org:9673/ ProxyPass /misc_ http://gyrfalcon.fhcrc.org:9673/misc_ ProxyPass /p_ http://gyrfalcon.fhcrc.org:9673/p_
and I'm sure you could change the "/" to something more appropriate, as well as the "eventual" location.
It was pointed out to me before that using mod_rewrite is a bit better, as you won't have to reauthenticate when going into your various SiteRoot folders. <URL:http://www.zope.org/Members/mwr/VHosts_With_Zope_Default> contains many examples. Another upside is that you can also serve non-Zope static content this way. Useful for some site migrations. me = { 'name' : 'Zachery Bir', 'email' : 'zbir@urbanape.com', 'voice' : '(804) 353-3742', 'url' : 'http://www.urbanape.com/' }
On Tue, 17 Jul 2001, Thomas T. Veldhouse wrote:
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ?
Give the VirtualHostMonster a try. It won't lock you out of your site like SiteRoot will if you aren't configured correctly. Add a VirtualHostMonster to the root of your Zope and read the instructions that are displayed. It's pretty straight-forward. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.org W. St. Paul, MN | | http://slashdot.org wilson@visi.com | <dtml-var pithy_quote> | http://linux.com
* Timothy Wilson <wilson@visi.com> [010717 20:12]:
On Tue, 17 Jul 2001, Thomas T. Veldhouse wrote:
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ?
Give the VirtualHostMonster a try. It won't lock you out of your site like SiteRoot will if you aren't configured correctly. Add a VirtualHostMonster to the root of your Zope and read the instructions that are displayed. It's pretty straight-forward.
Agreed. I'd go as far as to say it's now the recommended solution unless you have some other reason to use ProxyPass (although I'm not sure if I heard this from DC or not). It's certainly made my life immeasurably better :-) There's such a confusion of ways to do Virtual Hosts, it would be nice to get some kind of consensus on the 'recommended' way of doing it. It must be really confusing for newbies. seb
On Wed, Jul 18, 2001 at 11:43:47AM +0100, seb bacon wrote:
There's such a confusion of ways to do Virtual Hosts, it would be nice to get some kind of consensus on the 'recommended' way of doing it. It must be really confusing for newbies.
I propose my method (http://www.zope.org/Members/mwr/VHosts_With_Zope_Default). Since someone else mentioned it in the thread before I did, it must be usable, right? We've got working examples for Zope content, Apache static, Apache CGI, Apache PHP, Apache UserDirs, and Apache JServ. Plus, it further my secret plans to become supreme dictator of virtual host documentation (hope nobody finds out about that part...). -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Mike Renfro wrote:
I propose my method (http://www.zope.org/Members/mwr/VHosts_With_Zope_Default).
Very nice! Two notes: o What's the <IfModule> for? o It's "obvious" from context, but you might want to add a paragraph explaining what "my.real.host.name", "9763", and "CAE" are. On Wed, Jul 18, 2001 at 11:43:47AM +0100, seb bacon wrote:
There's such a confusion of ways to do Virtual Hosts, it would be nice to get some kind of consensus on the 'recommended' way of doing it.
As author of SiteAccess, I hereby nominate Mike's How-To :-) Cheers, Evan @ digicool & 4-am
* Evan Simpson <evan@4-am.com> [010718 15:04]:
Mike Renfro wrote:
I propose my method (http://www.zope.org/Members/mwr/VHosts_With_Zope_Default).
Very nice! Two notes:
o What's the <IfModule> for?
It's probably a bit redundant, because we can presume if someone has installed mod_rewrite then they've followed the install instructions, and preferably used apxs, which does this for them? Same goes for the LoadModule directives - plus the mod_proxy one is completely redundant. Also a tip with the STX [P] rendering problem: format it as a pre, by doing something like this.. httpd.conf:: <--- note double colon NameVirtualHost my.real.host.name <VirtualHost my.virtual.host.name> ... etc ...
On Wed, Jul 18, 2001 at 11:43:47AM +0100, seb bacon wrote:
There's such a confusion of ways to do Virtual Hosts, it would be nice to get some kind of consensus on the 'recommended' way of doing it.
As author of SiteAccess, I hereby nominate Mike's How-To :-)
As random zope punter, I second that. It would be good if someone could communicate this to the owners of the other SiteAccess / Virtual Hosting HOWTOs, so they can put a note at the top... seb
On Wed, Jul 18, 2001 at 03:54:25PM +0100, seb bacon wrote:
It's probably a bit redundant, because we can presume if someone has installed mod_rewrite then they've followed the install instructions, and preferably used apxs, which does this for them?
At least for the Debian folks (and possibly others who get a precompiled Apache), this won't necessarily be the case. Debian includes all the apache modules you'd normally want in their regular Apache package (actually apache-common, so it can be shared among both Apache and Apache-SSL), but doesn't enable all of them by default. And no, I'm not going to rebuild my Apache from source from scratch; I assume the Debian maintainer has far more of a clue than I about industrial-strength setups.
Same goes for the LoadModule directives - plus the mod_proxy one is completely redundant.
I thought I'd received an email (from Dave Cinege, perhaps? can't find it immediately in any case) that indicated it wasn't redundant. It may still be Debian-related, though.
Also a tip with the STX [P] rendering problem: format it as a pre, by doing something like this..
httpd.conf:: <--- note double colon
I've been using the :: syntax the whole time, actually. But look at the first RewriteRule now, and you'll see what I'm talking about. Bug in STX, perhaps? -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ?
Yeah, I've done that before too. I'm afraid I can't explain exactly why that happens (I never tried again), but your best bet to fix it is to FTP in and nuke the SiteRoot. There's also a way to set environment variables or some such to nullify the SiteRoot. Read the docs or source of SiteRoot to figure that out. --jcc
Tom, You are adding that /Zope/ to your path in your rewrite rules. Try a rewrite rule for each folder you what accessed directly. I think if you add the following to your httpd.conf it should do what you want. Then use /Zope/manage to manage your zope stuff, or you can add authorization statements for those to directories. RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] ## start add RewriteRule ^/site1/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site1/$1 RewriteRule ^/site2/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site2/$1 ## end add RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] Phil. Thomas T. Veldhouse wrote:
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ?
BTW -- I am running the latest stable Zope (2.3.3 ?) on FreeBSD 4.3-STABLE via the port and it uses Python 2.0. My current httpd.conf file has to following Zope related configuration:
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] <Directory /usr/local/www/cgi-bin.default> Options +ExecCGI </Directory>
Tom Veldhouse veldy@veldy.net
_______________________________________________ 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 )
I tried this, but unfortunately, some links get broken. For instance, the link to the zope image in std_html_footer (via the "ZopeAttributionButton") gets broken, because it strips the Zope out of the URL and then the image doesn't work for "Powered By Zope". Other than that -- it seems alright. RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/site1/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site1/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/site2/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site2/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] I also put a "Virtual Host Monster" in the folder, but it doesn't seem to have done anything at all. Tom Veldhouse veldy@veldy.net ----- Original Message ----- From: "Philip Aylesworth" <paylesworth@stclaircollege.ca> To: "Thomas T. Veldhouse" <veldy@veldy.net>; <zope@zope.org> Sent: Wednesday, July 18, 2001 9:44 AM Subject: Re: [Zope] Multiple Sites and Apache
Tom,
You are adding that /Zope/ to your path in your rewrite rules. Try a rewrite rule for each folder you what accessed directly. I think if you add the following to your httpd.conf it should do what you want. Then use /Zope/manage to manage your zope stuff, or you can add authorization statements for those to directories.
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] ## start add RewriteRule ^/site1/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site1/$1 RewriteRule ^/site2/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site2/$1 ## end add RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
Phil.
Thomas T. Veldhouse wrote:
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and whatever it did, it caused the Zope management interface to become unaccessable (both from Apache and 8080). Hmm ?
BTW -- I am running the latest stable Zope (2.3.3 ?) on FreeBSD 4.3-STABLE via the port and it uses Python 2.0. My current httpd.conf file has to following Zope related configuration:
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] <Directory /usr/local/www/cgi-bin.default> Options +ExecCGI </Directory>
Tom Veldhouse veldy@veldy.net
_______________________________________________ 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 )
Tom, Zope seems to have some hidden directories that it uses for some of its image files. If you look at the source for a page you will see that it uses http://www.example.com/p_/ZopeButton for the zope button. If you want to use it then you would have to add another rewrite rule for p_ directory (there may be others, too, anyone know?). RewriteRule ^/p_/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/p_$1 I assume that you are using apache for other non-Zope stuff? If not then you don't need apache at all, just use zope's server. I don't think you need Virtual Host Monster because you are not doing virtual hosting (more than one domain on the same instance of Zope). I am using it and apache rewrite for virtual hosting several domains on one Zope instance. Phil. Thomas T. Veldhouse wrote:
I tried this, but unfortunately, some links get broken. For instance, the link to the zope image in std_html_footer (via the "ZopeAttributionButton") gets broken, because it strips the Zope out of the URL and then the image doesn't work for "Powered By Zope".
Other than that -- it seems alright.
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/site1/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site1/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/site2/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site2/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
I also put a "Virtual Host Monster" in the folder, but it doesn't seem to have done anything at all.
Tom Veldhouse veldy@veldy.net
----- Original Message ----- From: "Philip Aylesworth" <paylesworth@stclaircollege.ca> To: "Thomas T. Veldhouse" <veldy@veldy.net>; <zope@zope.org> Sent: Wednesday, July 18, 2001 9:44 AM Subject: Re: [Zope] Multiple Sites and Apache
Tom,
You are adding that /Zope/ to your path in your rewrite rules. Try a rewrite rule for each folder you what accessed directly. I think if you add the following to your httpd.conf it should do what you want. Then use /Zope/manage to manage your zope stuff, or you can add authorization statements for those to directories.
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] ## start add RewriteRule ^/site1/(.*)
/usr/local/www/cgi-bin.default/Zope.cgi/site1/$1
RewriteRule ^/site2/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/site2/$1 ## end add RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
Phil.
Thomas T. Veldhouse wrote:
Why not ProxyPass + SiteRoot? 2 different ProxyPass statements, and a corresponding SiteRoot object in each subdirectory?
I am not familiar with ProxyPass. However, I did try SiteRoot and
whatever
it did, it caused the Zope management interface to become unaccessable
(both
from Apache and 8080). Hmm ?
BTW -- I am running the latest stable Zope (2.3.3 ?) on FreeBSD
4.3-STABLE
via the port and it uses Python 2.0. My current httpd.conf file has to following Zope related configuration:
RewriteEngine on RewriteRule ^/Zope$ /Zope/ [R] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/$1 [env=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] <Directory /usr/local/www/cgi-bin.default> Options +ExecCGI </Directory>
Tom Veldhouse veldy@veldy.net
_______________________________________________ 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 )
_______________________________________________ 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 )
Tom,
Zope seems to have some hidden directories that it uses for some of its image files. If you look at the source for a page you will see that it uses http://www.example.com/p_/ZopeButton for the zope button. If you want to use it then you would have to add another rewrite rule for p_ directory (there may be others, too, anyone know?).
I just copied the image and linked it directly. Saves the headache.
RewriteRule ^/p_/(.*) /usr/local/www/cgi-bin.default/Zope.cgi/p_$1
I assume that you are using apache for other non-Zope stuff? If not then you don't need apache at all, just use zope's server.
Yes, I have some JSP stuff. I also run a mailinglist using Mailman.
I don't think you need Virtual Host Monster because you are not doing virtual hosting (more than one domain on the same instance of Zope). I am using it and apache rewrite for virtual hosting several domains on one Zope instance.
Actually, I do have another domain that I host as a virtual domain. It is also in need of development. I wish I could find some more "readable" documentation on the Virtual Host Monster though. The current Zope hosted docs are confusing. The book leaves it to the administrators guide and the Administrators guide is unfinished. Thanks for all the help. I seem to be in business now! Tom Veldhouse veldy@veldy.net
On Wed, Jul 18, 2001 at 08:05:55PM -0500, Thomas T. Veldhouse wrote:
Actually, I do have another domain that I host as a virtual domain. It is also in need of development. I wish I could find some more "readable" documentation on the Virtual Host Monster though. The current Zope hosted docs are confusing. The book leaves it to the administrators guide and the Administrators guide is unfinished.
Tom, have you checked out my howto at http://www.zope.org/Members/mwr/VHosts_With_Zope_Default ? It covers Zope plus Apache static, PHP, Jserv, CGI, and UserDir content. Plus, at least one member of the Digicool cabal liked it. But more to the point with VHM docs, let's say I have a top-level folder in my Zope tree named "CAE" that I want to contain all the content for a particular virtual host, www.cae.tntech.edu. The third paragraph of the VHM Zope-hosted docs says "If the URL path of a request begins with "/VirtualHostBase/http/www.foo.com", for instance, then URLs generated by Zope will start with http://www.foo.com." Ok, the main Zope-generated URL you'd want to worry about is the one in the <base href> tag in the header of each page. So thus far, we know that if we want any URLs to cleanly derive from the www.cae.tntech.edu site, Zope will definitely have to see a request that begins with /VirtualHostBase/http/www.cae.tntech.edu -- and since *that particular request* is not something you'd expect the user to type in themselves, it'll have to come from an Apache rewrite rule. The last part of the third paragraph says we'll probably want to dump the port number, so the actual request to Zope will be /VirtualHostBase/http/www.cae.tntech.edu:80 Fourth paragraph translation -- anything that comes before the word VirtualHostRoot in the request will be stripped from any generated URLs. We don't want URLs of the form http://www.cae.tntech.edu/CAE/foo, so we need to make sure that the CAE entry comes before the word VirtualHostRoot in the request. Now our idea of the request Zope sees is almost complete: Zope sees a request of /VirtualHostBase/http/www.cae.tntech.edu:80/CAE/VirtualHostRoot, and will render it to the browser as http://www.cae.tntech.edu/.
From here on out, it's all Apache RewriteRules. You want to make sure that any requests to Apache for http://www.cae.tntech.edu/foo are sent to Zope as /VirtualHostBase/http/www.cae.tntech.edu:80/CAE/VirtualHostRoot/foo -- and that's the gist of sixth paragraph, which is really a far more condensed version of what I just spent the last page or so explaining.
For example, suppose you want to publish Folder "/foo" as http://www.foo.com/, where Zope is running on port 8080 behind Apache running on port 80. You place a Virtual Host Monster in the root Zope folder, and use Apache to rewrite "/(.*)" to http://localhost:8080/VirtualHostBase/http/www.foo.com:80/foo/VirtualHostRoo... The actual RewriteRule for my example site would be: RewriteRule ^/(.*) http://my.real.host.name:9673/VirtualHostBase/http/www.cae.tntech.edu:80/CAE... [P] all on one line. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Yes, this worked perfectly. Even though it was not actually a virtual host, but multiple sites on the same host using one instance of Zope. Excellent! Thanks for the advice and I also thank the author(s) of that page. Tom Veldhouse veldy@veldy.net ----- Original Message ----- From: "Mike Renfro" <renfro@tntech.edu> To: "Thomas T. Veldhouse" <veldy@veldy.net> Cc: "Philip Aylesworth" <paylesworth@stclaircollege.ca>; <zope@zope.org> Sent: Thursday, July 19, 2001 8:43 AM Subject: Re: [Zope] Multiple Sites and Apache
On Wed, Jul 18, 2001 at 08:05:55PM -0500, Thomas T. Veldhouse wrote:
Actually, I do have another domain that I host as a virtual domain. It is also in need of development. I wish I could find some more "readable" documentation on the Virtual Host Monster though. The current Zope hosted docs are confusing. The book leaves it to the administrators guide and the Administrators guide is unfinished.
Tom, have you checked out my howto at http://www.zope.org/Members/mwr/VHosts_With_Zope_Default ? It covers Zope plus Apache static, PHP, Jserv, CGI, and UserDir content. Plus, at least one member of the Digicool cabal liked it.
But more to the point with VHM docs, let's say I have a top-level folder in my Zope tree named "CAE" that I want to contain all the content for a particular virtual host, www.cae.tntech.edu.
The third paragraph of the VHM Zope-hosted docs says "If the URL path of a request begins with "/VirtualHostBase/http/www.foo.com", for instance, then URLs generated by Zope will start with http://www.foo.com." Ok, the main Zope-generated URL you'd want to worry about is the one in the <base href> tag in the header of each page.
So thus far, we know that if we want any URLs to cleanly derive from the www.cae.tntech.edu site, Zope will definitely have to see a request that begins with /VirtualHostBase/http/www.cae.tntech.edu -- and since *that particular request* is not something you'd expect the user to type in themselves, it'll have to come from an Apache rewrite rule.
The last part of the third paragraph says we'll probably want to dump the port number, so the actual request to Zope will be /VirtualHostBase/http/www.cae.tntech.edu:80
Fourth paragraph translation -- anything that comes before the word VirtualHostRoot in the request will be stripped from any generated URLs. We don't want URLs of the form http://www.cae.tntech.edu/CAE/foo, so we need to make sure that the CAE entry comes before the word VirtualHostRoot in the request.
Now our idea of the request Zope sees is almost complete: Zope sees a request of /VirtualHostBase/http/www.cae.tntech.edu:80/CAE/VirtualHostRoot, and will render it to the browser as http://www.cae.tntech.edu/.
From here on out, it's all Apache RewriteRules. You want to make sure that any requests to Apache for http://www.cae.tntech.edu/foo are sent to Zope as /VirtualHostBase/http/www.cae.tntech.edu:80/CAE/VirtualHostRoot/foo -- and that's the gist of sixth paragraph, which is really a far more condensed version of what I just spent the last page or so explaining.
For example, suppose you want to publish Folder "/foo" as http://www.foo.com/, where Zope is running on port 8080 behind Apache running on port 80. You place a Virtual Host Monster in the root Zope folder, and use Apache to rewrite "/(.*)" to
http://localhost:8080/VirtualHostBase/http/www.foo.com:80/foo/VirtualHostRoo t/$1
The actual RewriteRule for my example site would be:
RewriteRule ^/(.*)
http://my.real.host.name:9673/VirtualHostBase/http/www.cae.tntech.edu:80/CAE /VirtualHostRoot/$1 [P]
all on one line.
-- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (9)
-
Evan Simpson -
J. Cameron Cooper -
Mike Renfro -
Philip Aylesworth -
rossini@blindglobe.net -
seb bacon -
Thomas T. Veldhouse -
Timothy Wilson -
zbir@urbanape.com