I have an apache2 setup (Ubuntu 16, Apache 2.4.18) with a number of virtual hosts defined. Each virtualhost has it's own .conf file in /etc/apache2/sites-available with a softlink to /etc/apache2/sites-enabled.
All but one of the virtualhosts work correctly. I have triple checked that the ServerName
matches the domain (it does), but when I go to that domain, I end up at DocumentRoot
for the default virtualhost and I have no idea why. I also deleted and re-wrote the whole ServerName
line in case there was some hidden control character.
I have done a diff between one of the working virtualhosts and the one that doesn't work, and the only differences are the DocumentRoot
and the ServerName
.
I have checked that there are no other virtual hosts with the same domain (the only other one is the SSL virtual host)
Is there anything else I can look for to help figure out the issue?
EDIT: As requested, the VH file (domain name/folder obscured and comments removed for brevity)
<VirtualHost *:80> ServerName MYDOMAIN.COM ServerAdmin [email protected] DocumentRoot /var/www/MYDOMAIN.COM ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
EDIT 2: I removed the default VH and restarted, then the problem VH worked fine. I re-added the default VH and restarted, and the problem VH continued to work fine for about 20 seconds, then it reverted to the same problem.
ServerName
andDocumentRoot
it's identical to a working one, so I suspect the problem is outside of the VH file, I just have no idea what it could be!<Directory> ......
block