I finally need to move from my long-time working Apache 1.3 setup to
Apache 2. I'm testing with Paul Smedley's port of Apache 2.2.8.
Everything seems to work, except I cannot get my multi-ip/multi-domain
setup to work. Every request falls back to the default virtual host, no
matter what I do (like playing with UseCanonicalName). My httpd.conf
looks like this and works perfectly for 1.3:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot D:/WWW/HTML/DEFAULT
ServerName default.my.domain:port
...
</VirtualHost>
NameVirtualHost 1.1.1.1:80
<VirtualHost 1.1.1.1:80>
DocumentRoot D:/WWW/HTML/ip1host1
ServerName www.ip1host1.domain:80
...
</VirtualHost>
<VirtualHost 1.1.1.1:80>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip1host2.domain:80
...
</VirtualHost>
...
NameVirtualHost 1.1.1.2:80
<VirtualHost 1.1.1.2:80>
DocumentRoot D:/WWW/HTML/ip2host1
ServerName www.ip2host1.domain:80
...
</VirtualHost>
<VirtualHost 1.1.1.2:80>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip2host2.domain:80
...
</VirtualHost>
...
Whatever virtual host I point my browser to, all I get is the content of
D:/WWW/HTML/DEFAULT.
Starting apache with the -S option says "Syntax ok"; normal startup only
complains (correctly) about one DocumentRoot which indeed does not exist.
Any ideas? I searched both the web and usenet to no avail...
Cheers,
Robert
> NameVirtualHost *:80
> <VirtualHost *:80>
I think this will conflict with the same statements with specific IP addresses.
You either need to name all IP's or none of them.
--
Trevor Hemsley, Brighton, UK
Trevor dot Hemsley at ntlworld dot com
Thanks, Trevor. But if it is not different from Apache 1.3, which I
don't think it is, it specifies a default resource to serve when none of
the specific IP addresses to follow are met.
If I comment that portion out, I get "Forbidden - You don't have
permission to access / on this server" for every site I try to browse,
which is what I would expect to get if there's no DocumentRoot
configured for a site I try to browse...
Cheers,
Robert
to answer my own posting, I still found no solution, but a workaround:
Robert Schroeder wrote:
> D:/WWW/HTML/DEFAULT. [...]
I did it without explicitly specified IP addresses:
NameVirtualHost *
<VirtualHost *>
DocumentRoot D:/WWW/HTML/DEFAULT
ServerName default.my.domain
...
</VirtualHost>
<VirtualHost *>
DocumentRoot D:/WWW/HTML/ip1host1
ServerName www.ip1host1.domain
...
</VirtualHost>
<VirtualHost *>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip1host2.domain
...
</VirtualHost>
...
<VirtualHost *>
DocumentRoot D:/WWW/HTML/ip2host1
ServerName www.ip2host1.domain
...
</VirtualHost>
<VirtualHost *>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip2host2.domain
...
</VirtualHost>
Works perfectly, and will even make the next change of physical
addresses easier, if I may have to change the provider or something. I
still don't understand why the original attempt didn't work, though...
Cheers,
Robert