Simon Holywell

Text Post

Enabling sites and modules in Apache on Ubuntu or Debian

Apache HTTP Server

Apache HTTP Server


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”.

View Comments
Posted on Saturday, January 24, 2009. Tagged with: apachedebianmodulesubuntuvirtualhostingComputing

Comments powered by Disqus

Simon Holywell

My name is Simon Holywell and I am a Zend Certified PHP Developer with experience working for Web agencies, marketing companies and corporate IT in Australia and the United Kingdom. When I am not developing I can be found riding my motorbike, skateboarding or snowboarding. More information about my work history can be found on my online CV.

Facebook
LinkedIn
Flickr
Twitter
del.icio.us

Previous Next