Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So what makes the "default" vhost in apache a wildcard for unconfigured domains? ie. what makes this vhost be loaded over anything else when you try and load a domain that isn't configured, in a web browser? I have a feeling it could just be the lack of ServerName and ServerAlias arguments?

I have just set up a new Apache instance and created a new vhost alongside the default. Even when I specify a ServerName, run a2ensite and reload apache, it still loads the default page from the default vhost.

share|improve this question

The default virtual host is the very first one parsed. That's why in /etc/apache2/sites-enabled/ it usually is put as 000-default.

You can also check by using apache2ctl -S. It explicitly states which virtual host is the default one.

Maybe you have a typo in your configuration? Check the leading VirtualHost line for IP and port and check ServerName and ServerAlias for typos as well.

share|improve this answer

You must log in to answer this question.

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