Posts

Showing posts from February, 2024

Can't find site or site lands on wrong host

If you find that going to your URL works (DNS resolves), but it shows the wrong site on your server (your default site, alphabetically, from /var/www/), and, letsencrypt says no such site, and, a2enablesite says, no such site... then it's quite simple. The config file is missing or wrong in /etc/apache2/ Possible problems: 1. Wrong permissions on the config file. 2. The config file is in sites-available but not sites-enabled 3. The config file is in sites-enabled but not sites-available 4. The config file does not have a filename ending in . conf (really!!!) 5. The folder containing HTML does not match the path given in the config file (/var/www/mysite) If apache won't start at all 1. Your syntax in the config file is wrong. It should look like this (assuming your site is mysite.co.za) : <VirtualHost *:80> DocumentRoot /var/www/mysite Options All Indexes ExecCGI ServerName www.mysite.co.za ServerAlias mysite.co.za ErrorDocument 404 /error.html </VirtualHost> <Vi