Apache isn't respecting the ServerName directive for a particular site

Lost this question the other day.

When you have a <VirtualHost> container without a ServerName component, it will use the default hostname. As 000-default probably doesn't have a ServerName component, and is the first alphabetically to be included, that is why it answers for hostname.com and doesn't allow your explicitly declared hostname to work.


Do you have a NameVirtualHost *:80 directive somewhere?

Try:

/usr/sbin/apache2 -S

That will tell you how apache is parsing the config file. Do you have configs that have actual IPs or all have the *? Do you have any missing the :80? Apache doesn't like mixing those.

Do you have a ServerName domain.com or ServerAlias domain.com in default?