a2ensite
enable or disable an apache2 site / virtual host
see also :
apache2ctl
Synopsis
a2ensite
[site]
a2dissite
[site]
add an example, a script, a trick and tips
examples
source
a2dissite vhost && a2ensite
vhost && service apache2 reload
source
a2enmod shib2
a2ensite default-shib
source
a2dissite default
a2ensite jenkins
a2dissite default
Disables the default site.
source
for f in `ls
/home/`
do
a2ensite $f
read
done
/etc/init.d/apache2 reload
source
export alias ensite='sudo
a2ensite '
export alias dissite='sudo
a2ensite '
export alias enmod='sudo
a2enmod '
export alias dismod='sudo
a2enmod '
export alias a2ensite='sudo a2ensite '
export alias a2enmod='sudo
a2enmod '
export alias restart_apache='sudo apachectl restart'
source
sudo touch /var/run/mysqld/mysqld.sock
sudo a2ensite default
/etc/init.d/apache2 reload
source
if ! type
a2ensite &> /dev/null; then
echo "post-domain-enable/apache2: 'a2ensite' was not
found or does not exist" >&2
elif ! a2ensite "$OZ_DOMAIN_NAME" > /dev/null; then
echo "post-domain-enable/apache2: failed to enable domain
'$OZ_DOMAIN_NAME'" >&2
description
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.
files
/etc/apache2/sites-available
Directory with files giving information on available sites.
/etc/apache2/sites-enabled
Directory with links to the files in sites-available for
enabled sites.
see also
apache2ctl .
author
This manual
page was written by Stefan Fritsch <sf[:at:]debian[:dot:]org>
(based on the a2enmod manual page by Daniel Stone
<daniel[:at:]sfarc[:dot:]net>) for the Debian GNU/Linux
distribution.