Previous Section  < Day Day Up >  Next Section

Recipe 22.3. Adding New Modules After Installation

22.3.1 Problem

You configured your Apache server to support DSOs (Dynamic Shared Objects), and now you want to add some additional modules. They might be Apache modules or third-party modules.

22.3.2 Solution

For this example, let's say you've changed your mind and want to add mod_cgi, so you can run scripts. No problem, because you remembered to enable DSO capability at installation (see the previous recipe). This is a built-in Apache module, so you must run this command from the top level of your Apache build tree, installing the module to the libexecdir you configured at installation:

# ./configure —prefix=/usr/lib/httpd/modules/ —enable-cgi=shared

# make install

Then you must add the following directive to httpd.conf:

LoadModule rewrite_module /usr/lib/httpd/modules/mod_cgi.so

Restart Apache, and you're done.

Adding a third-party module can be done in two ways. If you preserved your Apache build tree, use this syntax:

# ./configure —add-module=module_type:/mod_foo.c —enable-foo=shared

# make install

Or use the apxs utility to build a third-party module outside of your build tree:

# apxs -c mod_foo.c

# apxs -i -a -n foo mod_foo.la

The real world, unfortunately, is not always this clear-cut. Many third-party Apache modules have specialized configuration and installation options, so be sure to follow the module instructions.

Removing a module is as simple as commenting out its entry in httpd.conf, then restarting Apache.

22.3.3 Discussion

There is a utility called ApacheToolbox that eases module management. It has nice menus for checking off what you want to install, then it does the download and installation for you. Find it at http://www.apachetoolbox.com.

22.3.4 See Also

    Previous Section  < Day Day Up >  Next Section