Virtual hosts (vHosts)

Activate a vHost

$> a2ensite 000-ask-sheldon.com

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

Deactivate a vHost

$> a2dissite 000-ask-sheldon.com

In contrast to the first example this command removes the symbolic /etc/apache2/sites-enabled/000-ask-sheldon.com. 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.