Apache ProxyPass and VirtualHostMonster
Hi everyone, I'm trying to get virtual hosting going with a VirtualHostMonster. I use Apache and ProxyPass like this for the root of my site (with a SiteRoot): <VirtualHost 111.222.333.444> ServerName foo.org ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /misc_ http://localhost:8080/misc_ ProxyPass /p_ http://localhost:8080/p_ </VirtualHost> I've created a VirtualHostMonster in the root of my Zope, and now I'd like to make a subfolder into a virtual host. For example, I want /spam to be at spam.foo.org. If I have the following configuration, I see my site at spam.foo.org, but spam.foo.org/manage gives a traceback and a "Resource not found" error. <VirtualHost 555.666.777.888> ServerName spam.foo.org ProxyPass / http://localhost:8080/VirtualHostBase/http/spam.isd197.org/spam/VirtualHostR... ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/spam.isd197.org/spam/VirtualHostR... ProxyPass /misc_ http://localhost:8080/VirtualHostBase/http/spam.isd197.org/spam/VirtualHostR... ProxyPass /p_ http://localhost:8080/VirtualHostBase/http/spam.isd197.org/spam/VirtualHostR... </VirtualHost> What am I missing? -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
Hello Timothy, I'm trying to get virtual hosting going with a VirtualHostMonster. I use Apache and ProxyPass like this for the root of my site (with a SiteRoot): <VirtualHost 111.222.333.444> ServerName foo.org ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /misc_ http://localhost:8080/misc_ ProxyPass /p_ http://localhost:8080/p_ </VirtualHost> I don't use VirtualHostMonster but instead ProxyPass and SiteRoot. I don't use the root folder of my Zope installation for anything. All other sites branch off the main. So: root -> site1 root -> site2 root -> site3 site1 answers to foo.org site2 answers to site2.foo.org site3 answers to site3.foo.org SiteRoot for site1 is configured as follows: Base: http://foo.org Path: / SiteRoot for site 2 is configured as follows: Base: http://site2.foo.org Path: / SiteRoot for site 3 is configured as follows: Base: http://site3.foo.org Path: / Apache is configured as follows: <VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass / http://mazope:8080/site1/ ProxyPassReverse / http://mazope:8080/site1/ ProxyPass /misc_ http://mazope:8080/site1/misc_ ProxyPass /p_ http://mazope:8080/site1/p_ </VirtualHost> <VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass / http://mazope:8080/site2/ ProxyPassReverse / http://mazope:8080/site2/ ProxyPass /misc_ http://mazope:8080/site2/misc_ ProxyPass /p_ http://mazope:8080/site2/p_ </VirtualHost> <VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass / http://mazope:8080/site3/ ProxyPassReverse / http://mazope:8080/site3/ ProxyPass /misc_ http://mazope:8080/site3/misc_ ProxyPass /p_ http://mazope:8080/site3/p_ </VirtualHost> Luke
Well I didn't see an answer for this so I will try and help. First in your root folder place a VirtualHostMonster Object. You can call it whatever you like Now to the Proxy Passing! At 04:58 PM 5/19/2001 -0400, luke tymowski wrote:
Hello Timothy,
I'm trying to get virtual hosting going with a VirtualHostMonster. I use Apache and ProxyPass like this for the root of my site (with a SiteRoot):
<VirtualHost 111.222.333.444> ServerName foo.org ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /misc_ http://localhost:8080/misc_ ProxyPass /p_ http://localhost:8080/p_ </VirtualHost>
I don't use VirtualHostMonster but instead ProxyPass and SiteRoot.
I don't use the root folder of my Zope installation for anything. All other sites branch off the main.
So: root -> site1 root -> site2 root -> site3
site1 answers to foo.org site2 answers to site2.foo.org site3 answers to site3.foo.org
SiteRoot for site1 is configured as follows: Base: http://foo.org Path: /
SiteRoot for site 2 is configured as follows: Base: http://site2.foo.org Path: /
SiteRoot for site 3 is configured as follows: Base: http://site3.foo.org Path: /
Get rid of the above SiteRoots. They will mess up the VHM (VirtualHostMonster) and how it was designed to work
Apache is configured as follows:
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass / http://mazope:8080/site1 ProxyPassReverse / http://mazope:8080/site1/ ProxyPass /misc_ http://mazope:8080/site1/misc_ ProxyPass /p_ http://mazope:8080/site1/p_ </VirtualHost>
Change to target this in your second setting of each proxypass modifying the folders to target properly excluding your misc_ and p_ folders http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/foo/VirtualHostRoot <VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass / http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo... ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass / http://mazope:8080/site2/ ProxyPassReverse / http://mazope:8080/site2/ ProxyPass /misc_ http://mazope:8080/site2/misc_ ProxyPass /p_ http://mazope:8080/site2/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass / http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost... ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass / http://mazope:8080/site3/ ProxyPassReverse / http://mazope:8080/site3/ ProxyPass /misc_ http://mazope:8080/site3/misc_ ProxyPass /p_ http://mazope:8080/site3/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass /http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHost... ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHost... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
Luke
_______________________________________________ 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 )
It can be complicated. I had trouble when I first Tried to setup a ProxyPass and VHM but once it click you will not have any trouble doing it. I hope this helps you out. SR ---------------------------------------------------- Sherwood Robinson Hostmaster The Free Lance-Star/Internet Department srobinson@fredericksburg.com http://www.fredericksburg.com 616 Amelia St. Fredericksburg, VA 22401 540-374-5000 ext. 5657
Hello Sherwood,
Well I didn't see an answer for this so I will try and help.
Actually Timothy Wilson asked how to do it using ProxyPass and VHM. I use SiteRoots not VHM and explained how to do it using SiteRoots instead. But my reply got a bit munged so it wasn't easy to tell that I was actually responding not asking. :) But no one else answered his question afaik so this should help them. thanks, Luke
First in your root folder place a VirtualHostMonster Object. You can call it whatever you like Now to the Proxy Passing!
Change to target this in your second setting of each proxypass modifying the folders to target properly excluding your misc_ and p_ folders http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/foo/VirtualHostRoot
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass / http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo... ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass / http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost...
ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass /http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHost... ProxyPassReverse / http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHost... ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
It can be complicated. I had trouble when I first Tried to setup a ProxyPass and VHM but once it click you will not have any trouble doing it. I hope this helps you out.
SR
Does any one know how to use VHM with such a httpd.conf : <VirtualHost www.toto.com> ServerAdmin webmaster@toto.com ServerName www.toto.com DocumentRoot /web/htdocs/www.toto.com ErrorLog logs/error.Apache CustomLog logs/access.www.toto.com combined # Cf. Zope/Apache HOW-TO RewriteEngine on RewriteCond %{REQUEST_URI} !^/static/ RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^(.*) http://www.toto.com:9080/www_toto_com/$1 [P] </VirtualHost> It does not work (does nothing) when I do not use a SiteRoot object avec cette config ! ----- Original Message ----- From: "Sherwood Robinson" <srobinson@fredericksburg.com> To: "luke tymowski" <luke@seeto.com>; <zope@zope.org> Sent: Monday, May 21, 2001 3:20 PM Subject: Re: [Zope] Apache ProxyPass and VirtualHostMonster
Well I didn't see an answer for this so I will try and help. First in your root folder place a VirtualHostMonster Object. You can call it whatever you like Now to the Proxy Passing!
At 04:58 PM 5/19/2001 -0400, luke tymowski wrote:
Hello Timothy,
I'm trying to get virtual hosting going with a VirtualHostMonster. I use Apache and ProxyPass like this for the root of my site (with a SiteRoot):
<VirtualHost 111.222.333.444> ServerName foo.org ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /misc_ http://localhost:8080/misc_ ProxyPass /p_ http://localhost:8080/p_ </VirtualHost>
I don't use VirtualHostMonster but instead ProxyPass and SiteRoot.
I don't use the root folder of my Zope installation for anything. All other sites branch off the main.
So: root -> site1 root -> site2 root -> site3
site1 answers to foo.org site2 answers to site2.foo.org site3 answers to site3.foo.org
SiteRoot for site1 is configured as follows: Base: http://foo.org Path: /
SiteRoot for site 2 is configured as follows: Base: http://site2.foo.org Path: /
SiteRoot for site 3 is configured as follows: Base: http://site3.foo.org Path: /
Get rid of the above SiteRoots. They will mess up the VHM
(VirtualHostMonster) and how it was designed to work
Apache is configured as follows:
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass / http://mazope:8080/site1 ProxyPassReverse / http://mazope:8080/site1/ ProxyPass /misc_ http://mazope:8080/site1/misc_ ProxyPass /p_ http://mazope:8080/site1/p_ </VirtualHost>
Change to target this in your second setting of each proxypass modifying the folders to target properly excluding your misc_ and p_ folders
http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/foo/VirtualHostRoot
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName foo.org ServerAlias www.foo.org foo.org ProxyPass /
http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo ot
ProxyPassReverse /
http://mazope:8080/VirtualHostBase/http/www.foo.com:8080/site1/VirtualHostRo ot
ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass / http://mazope:8080/site2/ ProxyPassReverse / http://mazope:8080/site2/ ProxyPass /misc_ http://mazope:8080/site2/misc_ ProxyPass /p_ http://mazope:8080/site2/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site2.foo.org ProxyPass /
http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost Root
ProxyPassReverse /
http://mazope:8080/VirtualHostBase/http/site2.foo.com:8080/site2/VirtualHost Root
ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass / http://mazope:8080/site3/ ProxyPassReverse / http://mazope:8080/site3/ ProxyPass /misc_ http://mazope:8080/site3/misc_ ProxyPass /p_ http://mazope:8080/site3/p_ </VirtualHost>
<VirtualHost 111.222.333.444> ServerAdmin webmaster@foo.org ServerName site3.foo.org ProxyPass
/http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHos tRoot
ProxyPassReverse /
http://mazope:8080/VirtualHostBase/http/site3.foo.com:8080/site3/VirtualHost Root
ProxyPass /misc_ http://mazope:8080/misc_ ProxyPass /p_ http://mazope:8080/p_ </VirtualHost>
Luke
_______________________________________________ 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 )
It can be complicated. I had trouble when I first Tried to setup a ProxyPass and VHM but once it click you will not have any trouble doing it. I hope this helps you out.
SR
---------------------------------------------------- Sherwood Robinson Hostmaster The Free Lance-Star/Internet Department
srobinson@fredericksburg.com http://www.fredericksburg.com
616 Amelia St. Fredericksburg, VA 22401 540-374-5000 ext. 5657
_______________________________________________ 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 )
On Mon, 21 May 2001, Olivier Deckmyn wrote:
RewriteRule ^(.*) http://www.toto.com:9080/www_toto_com/$1 [P]
You must pass osme information to it! Here is how I do it on zope.net.ru: RewriteRule ^/(.*) /cgi-bin/Zope.cgi/VirtualHostBase/http/zope.net.ru/zope.net.ru/VirtualHostRoot/$1 [e=3DHTTP_CGI_AUTHORIZATION:%1,t=3Dapplication/x-httpd-cgi,PT,NS,L] Read docs on VHM! Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (5)
-
luke tymowski -
Oleg Broytmann -
Olivier Deckmyn -
Sherwood Robinson -
Timothy Wilson