Apache mod_wcm.so configuration for Debian & Ubuntu


Debian & Ubuntu provide the apache2-mpm-prefork or apache2 packages for Apache 2.2 and 2.4 respectively. These are both installed by the Synaptic package manager or the apt-get command.

Operating SystemApache versionInstall packagemod_wcm library
Debian 5, 6 & 72.2apache2-mpm-preforkmod_wcm.so
Ubuntu 8 -> 122.2apache2-mpm-preforkmod_wcm.so
Debian 8 or later2.4apache2mod_wcm_24.so
Ubuntu 13 or later2.4apache2mod_wcm_24.so

To start and stop Apache, use the /usr/sbin/apache2ctl script.

The configuration of Apache has been separated out from /etc/apache2/httpd.conf. LoadModule directives are held in /etc/apache2/mods-available/*.load, while their configuration, eg Location clauses, are stored in /etc/apache2/mods-available/*.conf. To enable a module the .conf & .load files are symbolically linked into the /etc/apache2/mods-enabled directory. The modules themselves reside in the /usr/lib/apache2/modules directory.

So to implement our mod_wcm.so example, we would copy mod_wcm.so into /usr/lib/apache2/modules and create /etc/apache2/mods-available/wcm.load:

LoadModule wcm_module /usr/lib/apache2/modules/mod_wcm.so

The configuration for mod_wcm.so is then stored in a /etc/apache2/mods-available/wcm.conf file:

<Location /K8_CVS6 >
	Order allow,deny
	Allow from all
	# mod_filter and mod_deflate must be loaded
	AddOutputFilterByType deflate text/plain text/html text/css text/xml application/soap+xml
</Location>
<Location /K8_CVS6/KCMLTest >
	SetHandler kcml-soap
	KcmlSOAPServers localhost:790
</Location>

Finally wcm.conf and wcm.load are symbolically linked into the /etc/apache2/mods-enabled directory:

$ cd /etc/apache2/mods-enabled
$ ln -s ../mods-available/wcm.conf .
$ ln -s ../mods-available/wcm.load .

Apache 2.4 may be configured, by default, to use the event MPM, which is not compatible with mod_wcm_24.so. This can be easily changed by removing the symbolic links for the event MPM and then adding symbolic links for the prefork MPM.

$ cd /etc/apache2/mods-enabled
$ rm mpm_event.load mpm_event.conf
$ ln -s ../mods-available/mpm_prefork.conf .
$ ln -s ../mods-available/mpm_prefork.load .