Wednesday, September 2, 2015

a2ensite - Error! Site does not exist

You want to host multiple websites on the same IP with Apache, using VirtualHosts. So you created an extra VirtualHost file in /etc/apache2/sites-available directory

Then you run sudo a2ensite example.com and you get an error message: "a2ensite - Error! Site example.com does not exist"

SOLUTION
The new virtualhost file should have the extension .conf
Rename and run the command again. sudo a2ensite example.com.conf