The Linux Page

Turning sites and modules on and off in Apache2

I always have to looks for the command line option to turn sites and modules on and off (really it is said to be enabled or disabled.)

The commands are as follow:

  • a2ensite -- enable one site
  • a2dissite -- disable one site
  • a2enmod -- enable one module
  • a2dismod -- disable one module

When you use one of the commands in the command line terminal without specifying which site or module to enable, then you are given a list of the sites or modules you can enable or disable. Note that the configuration files have to end with .conf for this mechanism to work as expected.