The Debian family of linux distributions share a common - heavily customised - Apache HTTPD configuration. Though they're not exactly alike (Gentoo for example makes use of the IfDefine directive for enabling features), this guide will attempt to point out where they differ from the 'standard' upstream configuration layout, as available from httpd.apache.org.

For a high level overview of these platforms, and others, see DistrosDefaultLayout

Module Configuration

The Debian apache package for version 2.0 and greater puts module configuration files in /etc/apache2/mods-available and for version 2.2 /etc/apache22/mods-available. These files are not loaded in to the server by default. In order to enable them, symlinks are made in the /etc/apache2/mods-enabled directory pointing back to mods-available. There is a command line tool available to automate this process called a2enmod.

~$ # to enable mod_rewrite, for example
~$ a2enmod rewrite

Similarly there's a command named a2dismod which simply removes the symlink.

VirtualHost Configuration

In much the same way that modules are enabled and disabled, sites (VirtualHosts) are kept in /etc/apache2/sites-available and symlinked to /etc/apache2/sites-enabled with the a2ensite and a2dissite commands.

#Example of creating a new site (ie, vhost) in Ubuntu:
~$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mytestsite
Password:<password>
#Use your favorite editor and don't forget to remove the 
#NameVirtualHost line if copying from default
#(you can't have two NameVirtualHost directives with the same argument)
~$ sudo vi /etc/apache2/sites-available/mytestsite
~$ sudo a2ensite
Which site would you like to enable?
Your choices are: default mytestsite
Site name? mytestsite
Site mytestsite installed; run /etc/init.d/apache2 reload to enable.
~$ sudo /etc/init.d/apache2 reload
 * Reloading apache 2.0 configuration...                                         [ ok ]

Bundled Documentation

For further details, see the docs available in:

/etc/apache2/README
/usr/share/doc/apache*/README.Debian*

Package List

A complete (and up-to-date) list of all Debian packages for Apache can be obtained from http://packages.debian.org all you need to do is ensure you search for the appropriate package for the version of apache you are using.

For example, libapache2-mod-auth-pam is for Apache httpd v2.0+

Where as libapache-mod-auth-pam is for Apache httpd v1.3

Mixing versions of packages and Apache httpd will result in the module not working, and Apache possibly failing to start.

  • No labels