Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It seems that the if I go to my apache httpd-server with only the ip-address it will always default to the first vhost-config domain which is alphabetically first configured in the sites-enabled folder.

Now I have the case that some strange domain has as a DNS-resolution to our server which is obvisously wrong but results in error entries in my error.log file. If I enter this domain name in my browser I end up on one of my sites, actually the first on configured in the sites-enabled folder as vhost-config. This is the same behaviour as if I enter the ip-address of the server in my browser.

To solve this problem I entered a new virtual-host config file with the name aaa-catherror.conf which handles this cases as described in http://www.virtualmin.com/node/15688

But I wonder if this is the best solution.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If some unknown party points their hostname at your server's IP, the best you can do is create a dummy vhost and deny access to everything and everybody in it.

It would be even better if you made THAT vhost the first one, so that every hostanme that is not explicitly configured is denied.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.