a2ensite ERROR: Site www.example.com does not exist! Ubuntu 13.10

On our Ubuntu 13.10 server, I had created an apache configuration file for a virtual host however, I could not enable it using a2ensite. The file was here:

/etc/apache2/sites-available/www.example.com

I tried to enable it:

a2ensite www.example.com

However, the command complained that ERROR: Site www.example.com does not exist! The files clearly exists. It turns out the this command only works if the file ends with .conf. So

mv www.example.com www.example.com.conf
a2ensite www.example.com.conf

Voila it now work. Why or why doesn’t the developer give useful error messages. For example they should have write. Error – the files doesn’t have a .conf on the end!

4 thoughts to “a2ensite ERROR: Site www.example.com does not exist! Ubuntu 13.10”

Leave a Reply