httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jez Hancock <jez.hanc...@munk.nu>
Subject Re: [users@httpd] NameVirtualHost * with <VirtualHost IP>
Date Fri, 05 Dec 2003 08:03:03 GMT
On Fri, Dec 05, 2003 at 09:27:33AM +0300, D Kelmi wrote:
>  empty and www have the same IP. empty - it's default virtualhost for
>  all IP. If someone come to any IP with unknown Host - empty must
>  answer. Now I make this:
>  NameVirtualHost *
>  <VirtualHost *> empty </VirtualHost>
>  <VirtualHost *> www </VirtualHost>
>  and other VirtualHosts this * - it's work.
>  But i want use for all my vhosts (except empty) with IP. Construction
>  NameVirtualHost *
>  <VirtualHost *> empty </VirtualHost>
>  <VirtualHost IP> www </VirtualHost>
>  and other VirtualHosts this IP - it's must be work, but not working.
>  I think, it's bug.
It doesn't work because if a request comes in on <IP> address then the
first vhost entry corresponding to that specific <IP> address will be
used (which is 'www' by default).

Try using IP addresses everywhere in stead of * wildcards - see the
inline comments below:

# First IP address:
NameVirtualHost 1.1.1.1

<VirtualHost 1.1.1.1>
	# this config is used only if a request is made to 1.1.1.1 and no
	# corresponding vhost exists for the requested name:
	[ first vhost entry for 1.1.1.1 ]
</VirtualHost>

# ... other vhost entries to be served on 1.1.1.1

<VirtualHost 1.1.1.1>
	[ last vhost entry for 1.1.1.1 ]
</VirtualHost>

# Second IP address:
NameVirtualHost 2.2.2.2

<VirtualHost 2.2.2.2>
	# this config is used only if a request is made to 2.2.2.2 and no
	# corresponding vhost exists for the requested name:
	[ first vhost entry for 2.2.2.2 ]
</VirtualHost>

# ... other vhost entries to be served on 2.2.2.2

<VirtualHost 2.2.2.2>
	[ last vhost entry for 2.2.2.2 ]
</VirtualHost>

Not entirely sure I understand you though, if this isn't right you might
want to provide some concrete examples.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message