Blocking non-virtual host access in Apache?
- by cmbrnt
I'm running an apache-server, with a bunch of virtual hosts for about seven domain names. Now I'd like to disallow access for clients who try to access my server using only its IP-adress. So:
When someone accesses my website through www.domain.com, they reach the site hosted in /var/www/domain.com/public_html/.
When someone enters the ip-address of the server they reach a 403 Forbidden-message.
The problem with this is that they are theoretically able to reach my other sites through bruteforce, when getting http://11.22.33.44/domain.com/public_html/.
I rather want them to reach a 403 Forbidden all the time, as long as they don't access my server by a valid domain name.
How do I solve this problem?