How to Solve Error Message ERROR: Site does not exist !

Posted on

Introduction

This is an article where the main focus is to discuss an error message. The error message description exist in the title of this article. The error message is ‘ERROR: Site does not exist !’. That error message appear on executing a command to activate a website in Apache Webserver.The Apache Webserver in this context exists in a Ubuntu Linux operating system. Specifically, it is a Linux Ubuntu 18.4 version. Back to the focus on error appearing at the activation step. The activation process itself is actually done by typing a certain command in the command line interface. There are sequence of steps before the execution of the command as follows :

1. Create a file containing a website configuration for Apache Webserver. The content is not the main focus in this article. Just make sure that every line of the configuration is valid. Don’t forget to place it in the correct location. Usually, in Linux Ubuntu 18.04, it is actually exist in /etc/apache2/sites-available.

2. After successfully create the file, just execute the following command pattern :

a2ensite the-file-configuration-name

The execution command using the above command pattern exist as follows :

root@hostname ~# a2ensite 001-site-configuration
ERROR: Site 001-site-configuration does not exist!
root@hostname ~#

Solving the Problem

1. Solving the above error message is quite simple. Just check whether the file with the name of 001-site-configuration.conf exist in /etc/apache2/sites-available. The above error message output informing that the file with the name 001-site-configuration is not exist. The file with the name 001-site-configuration.conf is actually a specific file to define the site referred in the content of the configuration file. Make sure the file with the name 001-site-configuration.conf exist. Not only the name must be exactly the same but also the extension of the file must be a .conf file. The location of the file itself must also correct. Since it is the Apache Webserver, the file must be exist in the apache folder configuration.

2. After checking all the aspects, including the file name, the location name and also the extension of the file, just re-execute the above command. The following is the actual execution of the above command :

root@hostname sites-available(keystone)# a2ensite 001-site-configuration
Enabling site 004-site-configuration.
To activate the new configuration, you need to run:
  systemctl reload apache2
root@hostname sites-available(keystone)# systemctl reload apache2
apache2.service is not active, cannot reload.

The execution of the above command is possible even when the Apache Webserver’s service is off. In order to view the impact of the above command execution just start the Apache Webserver’s service. Access the URL of the website specified in the configuration file in the browser.

Leave a Reply