On 16.Jan 2005 - 23:14:01, Phillip Hutchings wrote:
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.
Yes there are some errors, but...
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
Correct.
<VirtualHost zope1.mysite.com:80> ServerName www.mysite.com RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:1234/VirtualHostBase/http/zope1.mysite.com/zope1/VirtualHos... [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:
Not if he wants to do name-based virtual hosts and thats probably what he wants, as the following doesn't make any sense at all...
NameVirtualHost *:80
<VirtualHost *:80> ServerName www.mysite.com RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:1234/VirtualHostBase/http/zope1.mysite.com/zope1/VirtualHos... $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/VirtualHos... [L,P] </VirtualHost>
<VirtualHost *:80> ServerName www.mysite.com RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:7777/$1 [L,P] </VirtualHost>
This doesn't make any sense and even though I'm not a apache-pro I don't think its correct at all. How does apache decide which VirtualHost to use? For the OP, if you use only the following NameVirtualHost and leave the rest as is, it should work: NameVirtualHost *:80 Andreas -- Don't plan any hasty moves. You'll be evicted soon anyway.