Installing apache modules


I have just installed apache (web server) from source but when I try to start it, it complains about the following line in my httpd.conf file:

LoadModule access_module modules/

I need to control acces to directories through the Allow and Deny directives, so I need the access module, right?

The error message is exactly:

httpd: Syntax error on line 185 of /var/httpd/conf/httpd.conf: Cannot load /var/httpd/modules/ into server: /var/httpd/modules/ cannot open shared object file: No such file or directory

There is indeed no files in /var/httpd/modules

I’ve tried to recompile apache adding the following to ./configure:
It accepts it, but once built and installed I get again the same error when trying to start the server.

Can anyone please let me know how to install the mod_access (or any other) module into the apache web server?

Thanks a lot for any help.

Its possible the modules are in /usr/lib/httpd/modules. But to be sure you can try running:

  find / -name

The problem is that if I change httpd.conf to use that file from another installation (even though it is Apache 2), with:

LoadModule access_module /usr/lib/httpd/modules/

the server complains with:

httpd: Syntax error on line 185 of /var/httpd/conf/httpd.conf: API module structure `access_module’ in file /usr/lib/httpd/modules/ is garbled - perhaps this is not an Apache module DSO?

Any ideas?

You can’t just use a module compiled for another installation like that.

OK, so the one you’re trying to install is Apache 2 right? Read this:

  1. mod_access is enabled by default in Apache 2 as a part of ‘Base’ unless you specifically remove it.

  2. It is --enable-<module_name> not --enable-module.

  3. To compile a DSO, you need this: --enable-<module_name>=shared or use apxs (after Apache has already been compiled).