Building dynamic modules on AIX: IBM HTTP Server
System Administration IBM HTTP Server documentation
Pertains to AIX users

Building dynamic modules on the AIX operating system using the Makefile.exmpl file

This section provides information on building dynamic modules on the AIX operating system, using the Makefile.exmpl file. This information includes locations of required files for building modules, instructions for building modules and using the APXS script. Links to related topics appear at the end of this section.

 

Locating required files for building modules

Building a module requires four files. Locate these files in the /usr/HTTPServer/example_module directory. This directory contains several files:

  • Export file for Apache and IBM HTTP Server functions: httpd.exp
  • Makefile for example dynamic shared object modules (DSOs): Makefile.exmpl
  • Sample module: mod_example.c
  • Sample module export file, required for the AIX operating system: mod_example.exp

Building a module

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 the Makefile.exmpl file to Makefile.
  7. Edit the file, 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.
    • Create an export file, based on the source file. For example, mod_example.exp
  8. Issue the make command.
  9. Copy the resulting .so file to the /usr/HTTPServer/libexec directory.
  10. Add the LoadModule and AddModule directives to the httpd.conf file, along with any module-specific directives.
  11. Restart the server.

For an example, switch to the /usr/HTTPServer/example_module directory and run the make command. This commands acts on the mod_example.c sample file and creates a .so file for the mod_example file. To build your own module, use the sample file, mod_example.c, as a template.

Using the APXS script on the AIX platform

The APXS script already has the compiler flags and link flags set for the AIX operating system. The syntax follows:

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

Note: The APXS script for the AIX operating system 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.

Note: Due to incompatibilities between mod_perl and the IBM HTTP Server AIX executable, running mod_perl as a Dynamic Shared Object (DSO) on AIX with the IBM HTTP Server is not recommended. For information on how to build mod_perl as a DSO on the IBM HTTP Server, you can refer to the Apache or mod_perl Web sites or forums.

 
Finding related information

     (Back to the top)