httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Harvey <Billy.Har...@thrillseeker.net>
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:
> 
> name.com with a DNS CNAME of www.name.com pointing to name.com
> 
> I am using named virtual servers for the www.name.com's and it works great. 
> However, if any of the plain old name.com 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 *>
  ServerName google.com
  ServerAdmin webmaster@rhinocomputing.com
  DocumentRoot /var/www/default
  ServerAlias google.com *.google.com
</VirtualHost>

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

default.ida
index.php
robots.txt

default.ida has some php code in it:

<?
header("Location: http://www.microsoft.com");
?>

and index.php has:

<?
header("Location: http://microsoft.com");
?>

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.

Billy


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message