Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

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.