Configuring and Managing MPE/iX Internet Services (July 2001)
178 Chapter9
Apache for MPE/iX
Major Components
directive is necessary when functions are called across object
boundaries such as mod_hw.o calling helloworld() in hw.o. The
share option is needed when global data is shared between multiple
object files. The share option is not actually needed by the sample code.
The compile and link steps can be put in a Makefile to facilitate
multiple builds of a module. As an example, refer to the section
“Modified APXS Makefile (mod_hw)”.
Mod_hw.so is now ready to be configured into Apache. To do this, refer
to the section “Configuring Apache Modules”.
Module Creation Using the APXS Utility
Modules can also be created using the bin/apxs utility “Apache
eXtenSion” tool. Details on using apxs are found in the apx manual
page, http://www.apache.org/docs/programs/apxs.html. Apxs is a
Perl script and requires a working Perl interpreter on the HP e3000.
The Perl interpreter is not distributed as part of FOS but is available as
freeware via http://jazz.external.hp.com. To prepare a system for
running apxs:
• Install the GNU tools.
• Install the Perl interpreter.
• Set up a Perl symbolic link.
shell/iX> ln -s /PERL/PUB/PERL /usr/local/bin/perl
Apxs has a number of options. The -g and -n options will create a
module skeleton with a corresponding Makefile. Log on as MGR.APACHE
in order to execute apxs and to create a module with MGR.APACHE as
the owner.
:HELLO MGR.APACHE
:XEQ SH.HPBIN.SYS -L
shell/iX> ./bin/apxs -g -n hw
Creating [DIR] hw
Creating [FILE] hw/Makefile
Creating [FILE] hw/mod_hw.c
shell/iX> cd hw
shell/iX> ls
Makefile mod_hw.c
Apxs -g -n will create directory “hw” with the module source file
mod_hw.c and its Makefile. This directory is where the module is
developed. Note that the mod_hw.c file created here is not the same as
the sample module code. To continue following this example, use the
code listings given for mod_hw.c and hw.c.
Makefile can be used for compiling and linking the module. The
default Makefile created here by apxs uses apxs for compiling and
linking. We recommend changing this to use gcc and LinkEditor as