Skip to main content

Apache2 enable and disable site(Ubuntu)

To enable or disable a site on apache we use two commands, a2ensite and a2dissite

“a2ensite” is used to enable and “a2dissite” is used to disable.

Both commands share same syntax

a2ensite website.com
a2dissite website.com

Where “website.com” is the name of your virtual host configuration file.

After running the commands, restart apache

systemctl restart apache2