Build dynamic modules on AIX: IBM HTTP Server
System Administration IBM HTTP Server documentation
Applies to AIX

Build Dynamic Modules on AIX Using Makefile.exmpl


Four files are required to build any module. These files are contained in the directory /usr/HTTPServer/example_module.

  • mod_example.c - Sample module
  • Makefile.exmpl - Makefile for example Dynamic Shared Object Modules (DSOs)
  • httpd.exp - Export file for Apache and IHS functions
  • mod_example.exp - Sample module export file (Required for AIX)
 

To build a module:

  1. Install the server.
  2. Copy the entire example_module directory to your build directory.
  3. Switch to the build directory.
  4. Copy your module.c file to the build directory
  5. .
  6. Rename Makefile.exmpl to Makefile
  7. 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.

      Note: The Makefile expects a source module EXPORT file based on the SRCFILE. For example, mod_example.exp

  8. Issue the make command.
  9. Copy the resulting .so file to /usr/HTTPServer/libexec.
  10. Add LoadModule and AddModule directives to httpd.conf, along with any module-specific directives.
  11. Restart the server.

For an example, switch to /usr/HTTPServer/example_module and run the make 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.

Using the APXS Script

The compiler flags and link flags are already set for AIX in the APXS script.

Syntax:

apxs -o mod_example.so -c *.c -bE: mod_example.exp

Note: The APXS script for AIX has an additional required option:

be: filename.exp

Failure to include this option on the APXS script results in the following message:
ld: 0711-244 ERROR: No csects or exported symbols have been saved
 
Related information...
Build Dynamic Shared Object Modules (DSOs) or Dynamic Link Libraries (DLLs) with IHS

     (Back to Top)