> -----Original Message-----
> From: Micha Lenk [mailto:mi...@lenk.info] 
> Sent: Montag, 22. August 2011 18:27
> To: dev@httpd.apache.org
> Subject: Re: With IP address in Host: header 
> ServerName/ServerAlias doesn't work
> 
> Hi Ruediger,
> 
> On 08/22/2011 06:16 PM CEST +02:00, "Plüm, Rüdiger, VF-Group" wrote:
> > No, this works as designed and documented for ages. I guess 
> your question is better
> > suited for the us...@httpd.apache.org list.
> 
> Sorry, I disagree. The documentation reads:
> 
>   Now when a request arrives, the server will first check if it is
>   using an IP address that matches the NameVirtualHost. If it is, then
>   it will look at each <VirtualHost> section with a matching 
> IP address
>   and try to find one where the ServerName or ServerAlias matches the
>   requested hostname. If it finds one, then it uses the configuration
>   for that server. If no matching virtual host is found, then 
> the first
>   listed virtual host that matches the IP address will be used.
> 
>   Source: http://httpd.apache.org/docs/2.2/en/vhosts/name-based.html
> 
> In the case I described earlier, *only* the virtual server v2 has a
> ServerName that matches the requested hostname. The last sentence from
> the cited documentation doesn't apply here.
> 

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.

Regards

Rüdiger

Reply via email to