|
|
Once a DSO has been compiled and linked, it needs to be configured. DSOs can be
configured manually or they can be configured with apxs. Configuration
consists of copying the DSO module to a known location then updating
httpd.conf to find and execute the DSO.
Manual Configuration
By convention, DSOs written in C reside in /APACHE/PUB/libexec. After
copying a DSO to this location, the AddModule and LoadModule
directives must be added to httpd.conf. An example of where to place
AddModule and LoadModule is shown in the httpd.conf
file for mod_example. Additional directives may be necessary to
configure a DSO's handler, depending on what the DSO is trying to accomplish.
:HELLO MGR.APACHE
:XEQ SH.HPBIN.SYS -L
shell/iX> cp hw/mod_hw.so libexec/mod_hw.so
shell/iX> vi conf/httpd.conf
...
# Note: The order is whch modules are loaded is important.
# Don't change the order below without expert advice
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
# LoadModule example_module libexec/mod_example.so
LoadModule hw_module libexec/mod_hw.so
...AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
#AddModule mod_example.c
AddModule mod_hw.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
...
Mod_hw includes a handler so the following additional directives are
added to httpd.conf:
...
<IfModule mod_hw.c>
<Location /hw>
SetHandler hw-handler
</Location>
</IfModule>
...
The LoadModule directive takes two arguments. The first is the name of
the module to load. This is the module's structure name taken from the source
file mod_hw.c. The second argument is the path to the shared object file
to load. The path can be relative to the server root (/APACHE/PUB), as
shown here, or it can be an absolute path.
APXS Configuration
To use apxs for configuration, use the install option of
Makefile. This will copy a module into libexec and
automatically update httpd.conf with the AddModule and
LoadModule directives. Additional configuration changes may be necessary
(such as manually configuring the hw-handler as shown in the manual
configuration) depending on what the module does:
:HELLO MGR.APACHE
:XEQ SH.HPBIN.SYS -L
shell/iX> cd hw
shell/iX> make install
/APACHE/PUB/bin/apxs -i -a -n 'hw' mod_hw.so
cp mod_hw.so /APACHE/PUB/libexec/mod_hw.so
chmod 755 /APACHE/PUB/libexec/mod_hw.so
[activating module `hw' in /APACHE/PUB/conf/httpd.conf]
|