[Zope] Apache and Zope
Phillip Hutchings
sitharus at gmail.com
Sun Jan 16 05:14:01 EST 2005
You've got the syntax completely wrong for name based virtual hosts,
you've done it for IP based virtual hosts, in which case the last
definition of the vhost for the ip address takes effect.
> NameVirtualHost zope1.mysite.com:80
The NameVirtualHost directive specifies the IP address Apache runs the
name based virtual host check on. On a host with only one IP address,
or multiple that should point to the same site, it goes like this:
NameVirtualHost *:80
> <VirtualHost zope1.mysite.com:80>
> ServerName www.mysite.com
> RewriteEngine On
> RewriteRule ^/(.*)
> http://127.0.0.1:1234/VirtualHostBase/http/zope1.mysite.com/zope1/VirtualHostRoot/$1
> [L,P]
> </VirtualHost>
The value in the VirtualHost 'tag' is the _IP ADDRESS_ that the
virtual host runs on, not the server name. This config will work:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.mysite.com
RewriteEngine On
RewriteRule ^/(.*)
http://127.0.0.1:1234/VirtualHostBase/http/zope1.mysite.com/zope1/VirtualHostRoot/
$1 [L,P]
</VirtualHost>
<VirtualHost *:80>
ServerName www.mysite.com
RewriteEngine On
RewriteRule ^/(.*)
http://127.0.0.1:1234/VirtualHostBase/http/zope2.mysite.com/zope2/VirtualHostRoot/$1
[L,P]
</VirtualHost>
<VirtualHost *:80>
ServerName www.mysite.com
RewriteEngine On
RewriteRule ^/(.*) http://127.0.0.1:7777/$1 [L,P]
</VirtualHost>
--
Phillip Hutchings
http://www.sitharus.com/
sitharus at gmail.com / sitharus at sitharus.com
More information about the Zope
mailing list