httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LuKreme <>
Subject [users@httpd] Re: how do I *define* a default virtual host
Date Wed, 16 Sep 2009 14:02:35 GMT
On 16-Sep-2009, at 07:17, Geurts, G.P.T.M. wrote:
> Thanks for your reply!
> I don't think it whould work for us.... we use ip based virtual  
> hosting
> so a virtualhost directive looks like <VitualHost>
> What does the __default__  directive do anyways?

_default_ is useful. Say you have 20 IPs on a single machine, and 12  
of those are assigned to various domains, but the other 8 are not.

Then you could have a _default_ directive AFTER all the other  
virtualhost directives, so that any IP address not previously set to a  
specific location would go to, say, your ecommerce page.

_default_ vhosts for all ports
Catching every request to any unspecified IP address and port, i.e.,  
an address/port combination that is not used for any other virtual host.

Server configuration

<VirtualHost _default_:*>
DocumentRoot /www/default

Using such a default vhost with a wildcard port effectively prevents  
any request going to the main server.

A default vhost never serves a request that was sent to an address/ 
port that is used for name-based vhosts. If the request contained an  
unknown or no Host: header it is always served from the primary name- 
based vhost (the vhost for that address/port appearing first in the  
configuration file).

OTOH, _default_ is dangerous, and you have to be sure that it is the  
LAST directive as it stomps everything that follows it.

"Why do you wear that stupid bunny suit?" "Why are you wearing that
	stupid man suit?"

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message