I've been staring at this for an hour and I'm just not seeing it. I know it will be something stupid but I need some other eyes on this because mine aren't catching it.
Standard Unbuntu Linode box with Apache on it. I've got 2 sites configured so far, and for some reason the second virtual host is not working; the site for the first one comes up instead.
The apache2.conf, httpd.conf and ports.conf are all 'standard' and unedited.
The ports.conf file contains these lines:
NameVirtualHost *:80 Listen 80
The two sites are in separate config files, they've been linked into the enabled-sites directory using a2ensite. I've triple checked that they are linked to the correct directories. Both of which happen to be Wordpress sites. I've also made sure the wordpress configs are correct and pointing to two different databases (and further confirmed that if I disable the 'first' site the second site starts showing up).
At this point I think that for some reason the VirtualHost directive is being ignored, but I'm doing something stupid with syntax? I've seen examples of syntax that include the domain name in the VirtualHost directive but that seems to be out of date and that ServerName syntax like below is preferred (and I tried the other way to no avail). Here is site one:
<VirtualHost *:80> ServerName imagethief.com ServerAlias www.imagethief.com DocumentRoot /var/www/imagethief.com/wordpress/ <Directory /var/www/imagethief.com/wordpress/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ErrorLog /var/www/imagethief.com/log/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/www/imagethief.com/log/access.log combined </VirtualHost>
And the second:
<VirtualHost *:80> ServerName nutritioneer.com ServerAlias www.nutritioneer.com DocumentRoot /var/www/nutritioneer/wordpress/ <Directory /var/www/nutritioneer/wordpress/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ErrorLog /var/www/nutritioneer/log/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/www/nutritioneer/log/access.log combined </VirtualHost>
What am I missing?
VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server imagethief.com (/etc/apache2/sites-enabled/imagethief.com:1) port 80 namevhost imagethief.com (/etc/apache2/sites-enabled/imagethief.com:1) port 80 namevhost nutritioneer.com (/etc/apache2/sites-enabled/nutritioneer.com:1) Syntax OK