Skip to content

ERROR: Site example.com does not exists! – Apache a2ensite command

Issue found during enabling website in Apache using a2ensite command. ERROR: Site example.com does not exists! - Apache a2ensite command

Category
Web Servers
Covers
Apache

Problem: ERROR: Site example.com does not exists!

This error I have faced when created a new virtual host in Apache on my Ubuntu system. I create a virtual host configuration file in /etc/apache2/sites-available/ directory with name example.com. Now I tried to enable the website using a2ensite command and faced the following issue.

a2ensite example.com 

ERROR:  Site example.com does not exists!

a2ensite-error-1

Solution:

The problem was that all virtual host configuration files must have .conf extension in their filename. So I simply renamed example.com with example.com.conf.

cd /etc/apache2/sites-available/
mv example.com example.com.conf

and again tried to enable website using same command and this time I found its working properly.

a2ensite example.com

a2ensite-error-1-solution

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

2 Comments

  1. THANK YOU!!!!
    It haunted me for days. All instructions refer to a2ensite _without_ the fact, that the .conf extension is crucial. Meanwhile I really got desperate, until I found this page.

    Thank you again!
    Wolfgang

  2. I’m getting apache2: could not reliably determine servers FQDN. ServerName is set to http://www.example.com.

    Also, DocumentRoot is set to /home.pikov/www but when I try to load 127.0.0.1, I get you don’t have permission to access / on this server.

    ???

    Thanks.

Leave a Reply

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


Back to top