Saturday, March 30, 2013

enable or disable an apache virtual host?

To enable an apache virtual host run the following command:
sudo a2ensite example.com
To disable an apache virtual host run the following command:
sudo a2dissite example.com
Both of the examples above assume you're interested in enabling/disabling the site configured via the following file:
/etc/apache2/sites-available/example.com
Lastly, if you're interested in learning more about the a2ensite/a2dissite command, checkout the following notes:
#This manual page documents briefly the a2ensite and a2dissite commands.

#a2ensite is a script that enables the specified site (which contains a
#<VirtualHost> block) within the apache2 configuration. It does this by
#creating symlinks within /etc/apache2/sites-enabled. Likewise,
#a2dissite disables a site by removing those symlinks. It is not an
#error to enable a site which is already enabled, or to disable one
#which is already disabled.

#The default site is handled specially: The resulting symlink will be
#called 000-default in order to be loaded first.

No comments:

Post a Comment