From b9985fa5deb936f4dc9bb6b3e5177738ca484a9a Mon Sep 17 00:00:00 2001 From: Yoshiki Hayashi Date: Sat, 3 Jan 2004 16:19:42 +0000 Subject: [PATCH] Update mod_example documentation to match 2.1 state. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102157 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_example.html.en | 62 +++++++++++++++-------------- docs/manual/mod/mod_example.xml | 62 +++++++++++++++-------------- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/docs/manual/mod/mod_example.html.en b/docs/manual/mod/mod_example.html.en index 9a4f349e44..c82a9c79de 100644 --- a/docs/manual/mod/mod_example.html.en +++ b/docs/manual/mod/mod_example.html.en @@ -29,14 +29,7 @@ SourceĀ File:mod_example.c

Summary

-
- This document has not been updated - to take into account changes made in the 2.0 version of the - Apache HTTP Server. Some of the information may still be - relevant, but please use it with care. -
- -

The files in the src/modules/example directory +

Some files in the modules/experimental directory under the Apache distribution directory tree are provided as an example to those that wish to write modules that use the Apache API.

@@ -70,43 +63,52 @@
  1. - Uncomment the "AddModule modules/example/mod_example" line - near the bottom of the src/Configuration file. - If there isn't one, add it; it should look like this: -

    - AddModule modules/example/mod_example.o -

    -
  2. - -
  3. Run the src/Configure script - ("cd src; ./Configure"). This will - build the Makefile for the server itself, and update the - src/modules/Makefile for any additional modules - you have requested from beneath that subdirectory.
  4. + Run configure with --enable-example + option. -
  5. Make the server (run "make" in the - src directory).
  6. +
  7. Make the server (run "make").

To add another module of your own:

    -
  1. mkdir src/modules/mymodule
  2. +
  3. cp modules/experimental/mod_example.c + modules/new_module/mod_myexample.c
  4. + +
  5. Modify the file.
  6. + +
  7. Create modules/new_module/config.m4. +
      +
    1. Add APACHE_MODPATH_INIT(new_module).
    2. +
    3. Copy APACHE_MODULE line with "example" from + modules/experimental/config.m4.
    4. +
    5. Replace the first argument "example" with myexample.
    6. +
    7. Replace the second argument with brief description of your module. + It will be used in configure --help.
    8. +
    9. If your module needs additional C compiler flags, linker flags or + libraries, add them to CFLAGS, LDFLAGS and LIBS accordingly. + See other config.m4 files in modules directory for + examples.
    10. +
    11. Add APACHE_MODPATH_FINISH.
    12. +
    +
  8. + +
  9. Create module/new_module/Makefile.in. + If your module doesn't need special build instructions, + all you need to have in that file is + include $(top_srcdir)/build/special.mk.
  10. -
  11. cp src/modules/example/* - src/modules/mymodule
  12. +
  13. Run ./buildconf from the top-level directory.
  14. -
  15. Modify the files in the new directory.
  16. +
  17. Build the server with --enable-myexample
  18. -
  19. Follow steps [1] through [3] above, with appropriate - changes.
top

Using the mod_example Module

To activate the example module, include a block similar to - the following in your srm.conf file:

+ the following in your httpd.conf file:

<Location /example-info>
SetHandler example-handler
diff --git a/docs/manual/mod/mod_example.xml b/docs/manual/mod/mod_example.xml index 2423981335..0bd2fea959 100644 --- a/docs/manual/mod/mod_example.xml +++ b/docs/manual/mod/mod_example.xml @@ -10,14 +10,7 @@ example_module

- - This document has not been updated - to take into account changes made in the 2.0 version of the - Apache HTTP Server. Some of the information may still be - relevant, but please use it with care. - - -

The files in the src/modules/example directory +

Some files in the modules/experimental directory under the Apache distribution directory tree are provided as an example to those that wish to write modules that use the Apache API.

@@ -41,43 +34,52 @@
  1. - Uncomment the "AddModule modules/example/mod_example" line - near the bottom of the src/Configuration file. - If there isn't one, add it; it should look like this: - - AddModule modules/example/mod_example.o - -
  2. + Run configure with --enable-example + option. -
  3. Run the src/Configure script - ("cd src; ./Configure"). This will - build the Makefile for the server itself, and update the - src/modules/Makefile for any additional modules - you have requested from beneath that subdirectory.
  4. - -
  5. Make the server (run "make" in the - src directory).
  6. +
  7. Make the server (run "make").

To add another module of your own:

    -
  1. mkdir src/modules/mymodule
  2. +
  3. cp modules/experimental/mod_example.c + modules/new_module/mod_myexample.c
  4. + +
  5. Modify the file.
  6. + +
  7. Create modules/new_module/config.m4. +
      +
    1. Add APACHE_MODPATH_INIT(new_module).
    2. +
    3. Copy APACHE_MODULE line with "example" from + modules/experimental/config.m4.
    4. +
    5. Replace the first argument "example" with myexample.
    6. +
    7. Replace the second argument with brief description of your module. + It will be used in configure --help.
    8. +
    9. If your module needs additional C compiler flags, linker flags or + libraries, add them to CFLAGS, LDFLAGS and LIBS accordingly. + See other config.m4 files in modules directory for + examples.
    10. +
    11. Add APACHE_MODPATH_FINISH.
    12. +
    +
  8. + +
  9. Create module/new_module/Makefile.in. + If your module doesn't need special build instructions, + all you need to have in that file is + include $(top_srcdir)/build/special.mk.
  10. -
  11. cp src/modules/example/* - src/modules/mymodule
  12. +
  13. Run ./buildconf from the top-level directory.
  14. -
  15. Modify the files in the new directory.
  16. +
  17. Build the server with --enable-myexample
  18. -
  19. Follow steps [1] through [3] above, with appropriate - changes.
Using the <code>mod_example</code> Module

To activate the example module, include a block similar to - the following in your srm.conf file:

+ the following in your httpd.conf file:

<Location /example-info>
SetHandler example-handler
-- 2.40.0