Installing apache modules

Hi,

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/mod_access.so

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/mod_access.so into server: /var/httpd/modules/mod_access.so: 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:
–enable-modules=mod_access
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 mod_access.so

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/mod_access.so

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/mod_access.so 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: http://httpd.apache.org/docs/2.0/install.html

  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).