Build dynamic modules on Linux
Four files are required to build any module. These are contained in the directory /opt/IBMHTTPServer/example_module.
- Install the server.
- Copy the entire example_module directory to the directory where you will do your build (the "build directory").
- Switch to the build directory.
- Copy your module.c file to the build directory
.
- Rename Makefile.exmpl to Makefile
- Edit Makefile and make the following changes:
- Replace SRCFILE with the name of the source file, without the extension.
- Replace PATHTOEXMPL with the path to the build directory.
- Issue the make command.
- Copy the resulting .so file to /opt/IBMHTTPServer/libexec.
- Add a LoadModule directive to httpd.conf, as well as any module specific directives.
- Restart the server.
For an example, switch to /opt/IBMHTTPServer/example_module and run the make -f Makefile.exmpl command.
This commands acts on the mod_example.c sample file and results in creating a .so file for mod_example. To build your own module, use the sample file (mod_example.c) as a template.