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/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so

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 (mod_access_compat.so):

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?

  • 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.
    – user9517
    Sep 24, 2013 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, 2013 at 9:02

3 Answers 3


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

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

eliminate mod_ and .so and load the result:

$ MODUL=mod_auth_basic.so
$ sudo a2enmod $(<<< $MODUL sed 's#mod_\(.*\)\.so#\1#')
Module auth_basic already enabled
  • 3
    This does not work with access_compat as I've shown above...
    – ezuk
    Sep 24, 2013 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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