Apache > HTTP Server > Documentation > Version 2.4

Dynamic Shared Object (DSO) Support

Available Languages:  en  |  fr  |  ja  |  ko  |  tr 

The Apache HTTP Server is a modular program where the administrator can choose the functionality to include in the server by selecting a set of modules. Modules will be compiled as Dynamic Shared Objects (DSOs) that exist separately from the main httpd binary file. DSO modules may be compiled at the time the server is built, or they may be compiled and added at a later time using the Apache Extension Tool (apxs).

Alternatively, the modules can be statically compiled into the httpd binary when the server is built.

This document describes how to use DSO modules as well as the theory behind their use.

See also



The DSO support for loading individual Apache httpd modules is based on a module named mod_so which must be statically compiled into the Apache httpd core. It is the only module besides core which cannot be put into a DSO itself. Practically all other distributed Apache httpd modules will then be placed into a DSO. After a module is compiled into a DSO named mod_foo.so you can use mod_so's LoadModule directive in your apache2.conf file to load this module at server startup or restart.

The DSO builds for individual modules can be disabled via configure's --enable-mods-static option as discussed in the install documentation.

To simplify this creation of DSO files for Apache httpd modules (especially for third-party modules) a support program named apxs (APache eXtenSion) is available. It can be used to build DSO based modules outside of the Apache httpd source tree. The idea is simple: When installing Apache HTTP Server the configure's make install procedure installs the Apache httpd C header files and puts the platform-dependent compiler and linker flags for building DSO files into the apxs program. This way the user can use apxs to compile his Apache httpd module sources without the Apache httpd distribution source tree and without having to fiddle with the platform-dependent compiler and linker flags for DSO support.


Usage Summary

To give you an overview of the DSO features of Apache HTTP Server 2.x, here is a short and concise summary:

  1. Build and install a distributed Apache httpd module, say mod_foo.c, into its own DSO mod_foo.so:

    $ ./configure --prefix=/path/to/install --enable-foo
    $ make install

  2. Configure Apache HTTP Server with all modules enabled. Only a basic set will be loaded during server startup. You can change the set of loaded modules by activating or deactivating the LoadModule directives in apache2.conf.

    $ ./configure --enable-mods-shared=all
    $ make install

  3. Some modules