httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] Should name based virtual hosts work when the ServerName is an IP address?
Date Thu, 31 May 2012 11:02:15 GMT
> # Listen on 192.200.0.1, 192.200.0.2, 192.200.0.3
> Listen *:80
> Listen *:1234 # <--- config for this not omitted below
>
> NameVirtualHost 192.200.0.1:80
>
> <VirtualHost 192.200.0.1:80>  # <--- *** THIS LINE ***
> ServerName will-not-resolve.example.com:80 # port no included as per docs
> # Default vhost for things that resolve to 192.200.0.1
> </VirtualHost>
>
> <VirtualHost 192.200.0.1:80>
> ServerName a.web.site.example.com:80 # port no included as per docs
> # VHost for http://a.web.site.example.com/
> </VirtualHost>
>
> <VirtualHost 192.200.0.1:80>
> ServerName 192.200.0.1:80  # port no included as per docs
> # VHost for http://192.200.0.1/
> </VirtualHost>
>
> # 192.200.0.2
> <VirtualHost 192.200.0.2:80>
>  # IP based Virtual Host goes here on 192.200.0.2
> </VirtualHost>

This config can avoid the problematic behavior by s/<VirtualHost
192.200.0.1:80>/<VirtualHost *:80> and letting normal name-based
resolution take over for everything other than 192.200.0.2.

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


Mime
View raw message