How to debug Apache VirtualHost not working

On an Apache webserver running in Ubuntu, I added a VirtualHost entry for a domain name. But instead of showing the page, it shows the website from the default Apache VirtualHost (000-default.conf). At first, I was thinking it is because Apache was somehow not able to handle Named Virtual Hosts. So I created another domain name on the server, that worked fine. Only this specific domain name VirtualHost did not work.

To see Apache VirtualHost configuration, run

When I run the above command, the domain name with the problem was listed as the default website. I changed 000-default.conf, no domain name was specified in the file. The problem was because the hostname of the server is the same as the domain name I was trying to set up.

To fix this, I change the hostname of the webserver with the command

Restart Apache web server

See Apache

Leave a Reply

Your email address will not be published. Required fields are marked *