httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Harvey <>
Subject Re: Named Based Virtual servers
Date Thu, 13 Dec 2001 02:15:40 GMT
On Wed, 2001-12-12 at 21:04, Matthew Daubenspeck wrote:
> I am using a bunch of name based virtual servers with Apache and Debain. 
> All of my domains are in the format of:
> with a DNS CNAME of pointing to
> I am using named virtual servers for the's and it works great. 
> However, if any of the plain old address is used, the first server 
> in httpd.conf is served.
> Do I have to add an entry for all of the named possibilities, or is there a 
> way to reject any other names except for the ones listed in httpd.conf.
> That sounds confusing as hell, but I can't think of another way to phrase it...

Matthew - I think you're asking how to serve a default page if someone
comes to the raw IP address?  Since I constantly have people probing my
IP address (virus weenies), I created an entry for the first named host
that would redirect them away:

NameVirtualHost *

<VirtualHost *>
  DocumentRoot /var/www/default
  ServerAlias *

and in that directory I have some files that are useful:


default.ida has some php code in it:


and index.php has:


to give those search engines that ignore the robots file something to
index.  The robots file has:

User-agent: *
Disallow: /

So, if someone probes my IP address instead of any of my virtual
domains, hopefully they will get nothing and be redirected away.


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

View raw message