httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micha Lenk <mi...@lenk.info>
Subject Re: With IP address in Host: header ServerName/ServerAlias doesn't work
Date Mon, 22 Aug 2011 16:54:56 GMT
Hi Rüdiger,

On 08/22/2011 06:39 PM CEST +02:00, "Plüm, Rüdiger, VF-Group" wrote:
> Sorry, I missed the ServerAlias for the IP in the second virtual host.
> So, yes in general the second virtual host should be hit.
> But using IP addresses as Serveralias is quite unusual and in this case
> the solution is to just reverse the definition of the virtual hosts.

Yes, an IP address in the HTTP Host header is quite unusual, granted!
But this is only how I discovered the issue...

The same problem exists for the following virtual host configuration,
assuming that v2.test.local has a proper DNS record that resolves to a
local IP address:

Listen v2.test.local:80 http
NameVirtualHost v2.test.local:80
<VirtualHost v2.test.local:80>
    ServerName v1.test.local
    DocumentRoot /srv/v1
</VirtualHost>
<VirtualHost v2.test.local:80>
    ServerName v2.test.local
    DocumentRoot /srv/v2
</VirtualHost>

In this case a HTTP/1.1 request for http://v2.test.local/ is served the
content from /srv/v1. Again, the problem is, that, if it matches, the
parameter from VirtualHost seems to override any ServerName or
ServerAlias directive.

Regards,
Micha

Mime
View raw message