Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an existing httpd.conf file which I am supposed to get to work on a Vagrant instance running Ubuntu, which I am using Puppet to provision.

The problem I am running up against is with module names. httpd.conf specifies a bunch of modules like so:

LoadModule access_compat_module modules/
LoadModule actions_module modules/
LoadModule alias_module modules/
LoadModule allowmethods_module modules/
LoadModule asis_module modules/
LoadModule auth_basic_module modules/

To set up all of these modules, I need to tell the Puppet Apache module I am using (by Example42) what module names I want to install and enable. The problem is that the module names are not a 1:1 match with the httpd.conf lines. In other words, module names cannot always be inferred from the file.

For example, here is me, trying to enable the first line on the file (

vagrant@lucid64:~$ sudo a2enmod access_compat             
ERROR: Module access_compat does not exist!               
vagrant@lucid64:~$ sudo a2enmod access_compat_module      
ERROR: Module access_compat_module does not exist!        
vagrant@lucid64:~$ sudo a2enmod accesscompat              
ERROR: Module accesscompat does not exist!            

tl;dr: How can I know the correct module name for a2enmod without trying to guess?

share|improve this question
look in mods-available to find available modules. You should be able to use grep -l to find the name of the file containing the mod definition which you should use. – Iain Sep 24 '13 at 8:34
Okay, so access_compat is not in mods-available... How do I install it? I mean, what should I do to download a mod in Ubuntu? – ezuk Sep 24 '13 at 9:02
up vote 1 down vote accepted

If the module you are searching for is a variable you can search for its name inside /etc/apache2/mods-available/

Use find command to search for a file that have that part of string you know about the mod,

e.g. find /etc/apache2/mods-available/ -name *\lite\*

output /etc/apache2/mods-available/charset_lite.load

put the string you want between *\...\* as what ever before or after this word

share|improve this answer
  • a2enmod [enter] -> see all available modules
  • apache2ctl -M -> see loaded modules (can be apachectl on RedHat)
share|improve this answer

eliminate mod_ and .so and load the result:

$ sudo a2enmod $(<<< $MODUL sed 's#mod_\(.*\)\.so#\1#')
Module auth_basic already enabled
share|improve this answer
This does not work with access_compat as I've shown above... – ezuk Sep 24 '13 at 9:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.