Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Configuring and Managing MPE/iX Internet Services: HP e3000 MPE/iX Computer Systems > Chapter 9 HP WebWise MPE/iX Secure Web Server

Creating Apache Modules

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

DSOs should be written in the C Programming language. DSOs written in C must be compiled on MPE/iX.

Two ways that Apache module's can be created are:

  1. From a template, such as mod_example.c, or from an existing module.

  2. With the apxs utility.

A sample module, mod_hw, will be used to illustrate these two methods for creating a DSO module in C. The mod_hw structure is shown in Figure 9-1 “Sample Module (mod_hw)”.

Figure 9-1 Sample Module (mod_hw)

Sample Module (mod_hw)

The mod_hw consists of two source files, mod_hw.c and hw.c. The file mod_hw.c contains the module structure and makes an external function call to pow() in the math library (/lib/libm). The mod_hw.c also makes an external function call to helloworld(), defined in hw.c. The output of mod_hw prints " Hello World" and also prints the result of raising 12 to the power of 2.

This module demonstrates how to build a DSO that calls external functions. Using mod_hw as an example, you will see how to compile and link an Apache module that calls an external function from an object file and calls an external function from a system library.

Note that modules are named mod_xxx.so by convention. To follow this convention, the sample module is called mod_hw.so.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.