2426N/A<!
DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2426N/A <
TITLE>Apache module mod_example</
TITLE>
2426N/A <
H1>Module mod_example</
h1>
2426N/A <
STRONG>is not</
STRONG> compiled in by default. It illustrates many of
2426N/A and, when used, demonstrates the manner in which module callbacks are
2426N/A Apache distribution directory tree are provided as an example to those
2426N/A that wish to write modules that use the Apache API.
2426N/A the different callback mechanisms and call syntaces. By no means does
2426N/A an add-on module need to include routines for all of the callbacks -
2426N/A The example module is an actual working module. If you link it into
2426N/A your server, enable the "example-handler" handler for a location, and
2426N/A then browse to that location, you will see a display of
2426N/A some of the tracing the example module did as the various callbacks
2426N/A To include the example module in your server, follow the steps below:
2426N/A <
LI>Uncomment the "Module example_module" line near the bottom of
2426N/A it; it should look like this:
2426N/A build the Makefile for the server itself, and update the
2426N/A have requested from beneath that subdirectory.
2426N/A <
LI>Make the server (run "<
SAMP>make</
SAMP>" in the <
CODE>src</
CODE>
2426N/A To add another module of your own:
<
LI><
SAMP>mkdir
src/
modules/<
EM>mymodule</
EM></
SAMP>
<
LI>Modify the files in the new directory.
<
LI>Follow steps [1] through [3] above, with appropriate changes.
Using the <
SAMP>mod_example</
SAMP> Module
To activate the example module, include a block similar to the
following in your <
SAMP>
srm.conf</
SAMP> file:
<Location /example-info>
SetHandler example-handler
As an alternative, you can put the following into a
><
SAMP>.htaccess</
SAMP></
A>
file and then request the file "
test.example" from that
AddHandler example-handler .example
to this location and see the brief display mentioned earlier.
<
LI><
A HREF="#example">Example</
A>
<
STRONG>Syntax:</
STRONG> Example
<
STRONG>Default:</
STRONG> None
<
STRONG>Context:</
STRONG> server config, virtual host, directory, .htaccess
<
STRONG>Override:</
STRONG> Options
<
STRONG>Status:</
STRONG> Extension
<
STRONG>Module:</
STRONG> mod_example
The Example directive activates the example module's content handler
for a particular location or file type. It takes no arguments. If
you browse to an URL to which the example content-handler applies, you
will get a display of the routines within the module and how and in
what order they were called to service the document request.