0

If I ask Apache for domain.com that has no Virtual Host setup in Apache configuration, Apache will show the default Virtual Host. How can I prevent this from happening or simply drop the connection?

3 Answers 3

1

Use a default virtual host configured to give the response you want in that situation.

Careful what you put there. I've seen clients get upset that we 'stole their domain' when the web host logo came up during some delegation issues =)

1

This is expected behavior - if you have Apache serving on an IP that a domain resolves to but don't have that domain set up as a virtual host, you get the default virtual host. That's just how it works.

1
  • Thank you but is this OK for a nameserver to open Apache default virtualhost?
    – Zim3r
    Dec 14, 2012 at 19:44
1
Listen 80
NameVirtualHost *

<VirtualHost _default_:80>
    RewriteEngine On
    RewriteRule . - [G]
</VirtualHost>

This will send an HTTP 410 "Gone".

You can't prevent it from happening. Apache still needs to listen on that port and it has to do something with that connection.

1
  • It should. What errors are you seeing?
    – ablackhat
    Dec 15, 2012 at 20:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .