Linux Commands Examples

A great documentation place for Linux commands

a2dissite

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

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

2
source
            
a2dissite vhost && a2ensite vhost && service apache2 reload
1

a2dissite default

Disables the default site.


1
source
            
a2dismod shib2
a2dissite default-shib
remove_templates "apache" "colony_mod_shib2"
apt-get -y remove libapache2-mod-shib2
1
source
            
if ! type a2dissite &> /dev/null; then
echo "post-domain-delete/apache2: 'a2dissite' was not found or does not exist" >&2
elif ! a2dissite "$OZ_DOMAIN_NAME" > /dev/null; then
echo "post-domain-delete/apache2: failed to disable domain '$OZ_DOMAIN_NAME'" >&2
1
source
            
sudo a2dissite default && sudo a2ensite ss &&sudo service apache2 reload
0
source
            
a2enmod vhost_alias
a2dissite default
a2ensite jenkins
0
source
            
a2enmod xsendfile
a2dissite default
a2dissite 000-default
service apache2 reload
chown -R lamp.lamp /var/www
0
source
            
if ! type a2dissite &> /dev/null; then
echo "post-domain-disable/apache2: 'a2dissite' was not found or does not exist" >&2
elif ! a2dissite "$OZ_DOMAIN_NAME" > /dev/null; then
echo "post-domain-disable/apache2: failed to disable domain '$OZ_DOMAIN_NAME'" >&2
0
source
            
sudo a2dissite ss && sudo a2ensite default && sudo service apache2 reload
0
source
            
a2enmod vhost_alias
a2enmod rewrite
a2enmod xsendfile
a2dissite default
a2dissite 000-default
service apache2 reload
chown -R lamp.lamp /var/www

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.

How can this site be more helpful to YOU ?


give  feedback