httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Bligh <a...@alex.org.uk>
Subject Re: [users@httpd] Should name based virtual hosts work when the ServerName is an IP address?
Date Tue, 29 May 2012 15:40:42 GMT


--On 29 May 2012 16:02:25 +0200 Matus UHLAR - fantomas <uhlar@fantomas.sk> 
wrote:

> This was documented feature in 1.3 and 2.0:
>
> The complete list of names in the VirtualHost  directive are treated just
> like a ServerAlias (but are not overridden by any ServerAlias statement)
> if all names resolve to the same address set. Note that subsequent Listen
> statements for this vhost will not affect the ports assigned in the
> address set.
>
> It seems that in 2.2 it should work as you expect. Do you still use 2.0
> or does this problem apply in 2.2 too?
> (I've checked now and seems it's gone in 2.2)

I am using 2.2 (latest from Ubuntu Lucid).

I am not using ServerAlias.

I am not sure how to parse your second paragraph. There is only one
Listen statement as this is a NameVirtualHost (in this case a Listen
for *:80). NameVirtualHost is on 192.200.0.1:80 because there are
non-namebased virtual hosts on other IP addresses.

I think what you are saying is that in 1.3 and 2.0 the first declared
virtual host not only acts as the default virtual host but also as if
it had an alias defined for the IP address/port pair it is listening
on. My understanding from the documentation is that this is not the
intended behaviour on 2.2 - i.e. each vhost should be responding only
for its defined ServerAlias and ServerName, and if none match the
default should be used. That does not /appear/ to be happening, so perhaps
the behaviour has not changed from the 1.3/2.0 behaviour you describe.

Is that meant to be the case?

If so, is there any way around this? (i.e. so an arbitrary DNS name pointing
to the IP address will get the default vhost, but the IP address itself
will get a different vhost).

-- 
Alex Bligh

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message