Home of mod_example_ipc


What is it?

The mod_example_ipc module showcases the use in an Apache 2.0 module of the Shared Memory and Mutex routines found in the Apache Portable Runtime. The module itself does nothing useful.

The Latest Version

mod_example_ipc has been contributed to the Apache HTTP Server source code. Find it in the source tree at the Apache Subversion repository.

Earlier versions are no longer being offered here, but can be retrieved from the Apache Subversion history.


Using apxs is the easiest. It requires perl to run the apxs script, and the same C compiler that you built Apache with. Simply run

$ /path/to/apache2/bin/apxs -c -i mod_example_ipc.c

from the module source directory. This compiles the source as a shared module and installs it under /path/to/apache2/modules.

Once you build the module, you can activate it in the Apache configuration as follows:

# You only need this if you built the module as a shared library
LoadModule example_ipc_module modules/mod_example_ipc.so

<Location /example_ipc>
    SetHandler example_ipc

Now, any call to http://yourserver/example_ipc will cause the module's handler to grab the lock, increment the shared memory counter and return a small HTML page. Run a benchmark tool with multiple parallel sessions (like ab which comes with Apache) against this URL to see the effect of the IPC.

This page Copyright © 2004, 2011 Sander Temme