Virtual hosts (vHosts)

Activate a vHost

$> a2ensite

In this example refers to the vhost configuration that is defined under /etc/apache2/sites-available/ .
a2ensite creates a symbolic link under /etc/apache2/sites-enabled with the name that points to the configuration file /etc/apache2/sites-available/ So you can see, that you can do it manually too. 

Deactivate a vHost

$> a2dissite

In contrast to the first example this command removes the symbolic /etc/apache2/sites-enabled/ So the vHost is deactivated again.

Test configuration

To check if your server configuration is correct you can use the following command before restarting the webserver and indeed activate the recent changes:

$> apachectl configtest

If there are errors in your configuration (any), they will be shown.

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.