You will need to have installed/created:

Sudo or root access
Folder Path Directory
  • Create a virtual host for the website, by copying and renaming the default configuration file in apache
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/(
  • Edit virtual host conf file
sudo nano /etc/apache2/sites-available/(

The config file should look like this in the end:

ServerAdmin webmaster@localhost
DocumentRoot /var/www/(
ServerName (
ServerAlias (
  <Directory /var/www/(>
    AllowOverride All
ErrorLog ${APACHE\_LOG\_DIR}/error.log
CustomLog ${APACHE\_LOG\_DIR}/access.log combined
  • Enable the virtual hosts
sudo a2ensite (

You will get the message below

Enabling site (
To activate the new configuration, you need to run:
service apache2 reload
  • Reload apache
sudo service apache2 restart

All done :D

Share on LinkedIn
Share on Reddit