devo devo - 28 days ago 7
Apache Configuration Question

Site does not exist error for a2ensite

I have

cmsplus.dev
under
/etc/apache2/sites-available
with the following code,

<VirtualHost *:80>
ServerAdmin master@server.com
ServerName www.cmsplus.dev
ServerAlias cmsplus.dev

DocumentRoot /var/www/cmsplus.dev/public

LogLevel warn
ErrorLog /var/www/cmsplus.dev/log/error.log
CustomLog /var/www/cmsplus.dev/log/access.log combined
</VirtualHost>


Now when I use
sudo /usr/sbin/a2ensite cmsplus.dev
, I am getting the error,

ERROR: Site cmsplus.dev does not exist!


My webserver
Apache/2.4.6 (Ubuntu)


How to solve this issue?

Answer

Solved the issue by adding .conf extension to site configuration files.

Apache a2ensite results in:

Error! Site Does Not Exist

Problem; If you found the error while trying to enable a site using:

sudo a2ensite mysite.com

but it returns:

Error: mysite.com does not exist

a2ensite is simply a perl script that only works with filenames ending .conf

Therefore, I have to rename my setting file for mysite.com to mysite.com.conf as might be achieved as follows:

mv /etc/apache2/sites-available/mysite.com /etc/apache2/sites-available/mysite.com.conf

Success