Home > Software design >  Apache error on ubuntu ERROR: Site (SiteName) does not exist
Apache error on ubuntu ERROR: Site (SiteName) does not exist

Time:06-22

I'm facing a problem when I run sudo a2ensite test.watermaps-eg.com.conf to add a new site to apache2 it gives me ERROR: Site test.watermaps-eg.com does not exist!

What I tried to do

Added the file test.watermaps-eg.com.conf inside sites-enabled.

Added the apache2 configurations inside the file.

<VirtualHost *:80>
    ServerName https://test.watermaps-eg.com
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName test.watermaps-eg.com
    DocumentRoot /home/ubuntu/test_water_maps_django
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    Alias /static /home/ubuntu/test_water_maps_django/static
    <Directory /home/ubuntu/test_water_maps_django/static>
    Require all granted
    Order Allow,Deny
    Allow from all
    AllowOverride all
    </Directory>
    <Directory /home/ubuntu/test_water_maps_django/kml_files>
    Require all granted
    </Directory>
    <Directory /home/ubuntu/test_water_maps_django/water_maps>
    Require all granted
    Order Allow,Deny
    Allow from all
    AllowOverride all
    <Files wsgi.py>
    Require all granted
    </Files>
    </Directory>
    WSGIDaemonProcess test_water_maps_django python-path=/home/ubuntu/test_water_maps_django python-home=/home/ubuntu/test_water_maps_django/venv
    WSGIProcessGroup test_water_maps_django
    WSGIScriptAlias / /home/ubuntu/test_water_maps_django/water_maps/wsgi.py
    WSGIPassAuthorization On
</VirtualHost>

I ran the command sudo a2ensite test.watermaps-eg.com.conf and it returns the mentioned above error.

CodePudding user response:

You might want to add the conf (test.watermaps-eg.com.conf) file inside /etc/apache2/site-available before running the command

sudo a2ensite test.watermaps-eg.com
  • Related