README
1README for Apache 2.0 Example Module
2[April, 1997, updated May 2000]
3
4The files in the src/modules/example directory under the Apache
5distribution directory tree are provided as an example to those that
6wish to write modules that use the Apache API.
7
8The main file is mod_example.c, which illustrates all the different
9callback mechanisms and call syntaces. By no means does an add-on
10module need to include routines for all of the callbacks - quite the
11contrary!
12
13The example module is an actual working module. If you link it into
14your server, enable the "example-handler" handler for a location, and then
15browse to that location, you will see a display of some of the tracing
16the example module did as the various callbacks were made.
17
18To include the example module in your server add --enable-example to the
19other ./configure arguments executed from the httpd-2.1 directory. After
20that run 'make'.
21
22To add another module of your own:
23
24 A. cp modules/experimental/mod_example.c modules/experimental/mod_myexample.c
25 B. Modify the file
26 C. Build the server with --enable--myexample
27
28To activate the example module, include a block similar to the
29following in your httpd.conf file:
30
31 <Location /example-info>
32 SetHandler example-handler
33 </Location>
34
35As an alternative, you can put the following into a .htaccess file and
36then request the file "test.example" from that location:
37
38 AddHandler example-handler .example
39
40After reloading/restarting your server, you should be able to browse
41to this location and see the brief display mentioned earlier.
42