Enabling sites and modules in Apache on Ubuntu or Debian· 1 minute read
I really like the way the Apache modules and virtualhosts are seperated out on Debian into folders containing those, which are available and those which are enabled. There is one small problem with this – it is more work than before! Luckily there are some helper scripts.
The Apache configuration files are layed out in the following way:
mods-available – the actual text files containing the modules configuration sites-available – the vhosts text file for the site
mods-enabled – a symlink to the actual text file in mods-available sites-enabled – a symlink to the actual text file in sites-available
Anything listed in the enabled directories will be loaded when Apache is therefore enabling the respective site or module. Manually symlinking these up can be a right pain so I use the following scripts to assist me:
“a2ensite sitename” – will create the symlink for you “a2dissite sitename” – will remove the symlink for you “a2enmod modulename” – will create the symlink for you “a2dismod modulename” – will remove the symlink for you
When the symlink is place the module or site will be loaded and vice versa.
Do not forget that you still need to reload the configurations into Apache by running “/etc/init.d/apache2 reload”.