Recipe 22.3. Adding New Modules After Installation

 < Day Day Up > 

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

  • Recipe 22.5

  • http://localhost/manual/dso.html

  • http://localhost/manual/mod/

  • The Apache 2.0 documentation (http://httpd.apache.org/docs-2.0)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net