README revision 0f081398cf0eef8cc7c66a535d450110a92dc8ae
6359N/AREADME for Apache 1.2 Example Module
6359N/A[April, 1997]
6359N/A
6359N/AThe files in the src/modules/example directory under the Apache
6359N/Adistribution directory tree are provided as an example to those that
6359N/Awish to write modules that use the Apache API.
6359N/A
6359N/AThe main file is mod_example.c, which illustrates all the different
6359N/Acallback mechanisms and call syntaces. By no means does an add-on
6359N/Amodule need to include routines for all of the callbacks - quite the
6359N/Acontrary!
6359N/A
6359N/AThe example module is an actual working module. If you link it into
6359N/Ayour server, enable the "example-handler" handler for a location, and then
6359N/Abrowse to that location, you will see a display of some of the tracing
6359N/Athe example module did as the various callbacks were made.
6359N/A
6359N/ATo include the example module in your server, follow the steps below:
6359N/A
6359N/A 1. Uncomment the "Module example_module" line near the bottom of
6359N/A the src/Configuration file. If there isn't one, add it; it
6359N/A should look like this:
6359N/A
6359N/A Module example_module modules/example/mod_example.o
6359N/A
6359N/A 2. Run the src/Configure script ("cd src; ./Configure"). This will
6359N/A build the Makefile for the server itself, and update the
6359N/A src/modules/Makefile for any additional modules you have
6359N/A requested from beneath that subdirectory.
6359N/A
6359N/A 3. Make the server (run "make" in the src directory).
6359N/A
6359N/ATo add another module of your own:
6359N/A
6359N/A A. mkdir src/modules/mymodule
6359N/A B. cp src/modules/example/* src/modules/mymodule
6359N/A C. Modify the files in the new directory
6359N/A D. Follow steps [1] through [3] above, with appropriate changes.
6359N/A
6359N/ATo activate the example module, include a block similar to the
6359N/Afollowing in your srm.conf file:
6359N/A
6359N/A <Location /example-info>
6359N/A SetHandler example-handler
6359N/A </Location>
6359N/A
6359N/AAs an alternative, you can put the following into a .htaccess file and
6359N/Athen request the file "test.example" from that location:
6359N/A
6359N/A AddHandler example-handler .example
6359N/A
6359N/AAfter reloading/restarting your server, you should be able to browse
6359N/Ato this location and see the brief display mentioned earlier.
6359N/A