diff options
author | Yoshiki Hayashi <yoshiki@apache.org> | 2004-01-03 17:19:42 +0100 |
---|---|---|
committer | Yoshiki Hayashi <yoshiki@apache.org> | 2004-01-03 17:19:42 +0100 |
commit | b9985fa5deb936f4dc9bb6b3e5177738ca484a9a (patch) | |
tree | a29e18c7d6e42d307e08a40e0f9361b37b84bcbd /docs/manual/mod/mod_example.xml | |
parent | Add missing apr_ to size_t. (diff) | |
download | apache2-b9985fa5deb936f4dc9bb6b3e5177738ca484a9a.tar.xz apache2-b9985fa5deb936f4dc9bb6b3e5177738ca484a9a.zip |
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
Diffstat (limited to 'docs/manual/mod/mod_example.xml')
-rw-r--r-- | docs/manual/mod/mod_example.xml | 62 |
1 files changed, 32 insertions, 30 deletions
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 @@ <identifier>example_module</identifier> <summary> -<note type="warning"> - 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. -</note> - - <p>The files in the <code>src/modules/example directory</code> + <p>Some files in the <code>modules/experimental</code> directory under the Apache distribution directory tree are provided as an example to those that wish to write modules that use the Apache API.</p> @@ -41,43 +34,52 @@ <ol> <li> - Uncomment the "AddModule modules/example/mod_example" line - near the bottom of the <code>src/Configuration</code> file. - If there isn't one, add it; it should look like this: -<example> - AddModule modules/example/mod_example.o -</example> - </li> + Run <code>configure</code> with <code>--enable-example</code> + option.</li> - <li>Run the <code>src/Configure</code> script - ("<code>cd src; ./Configure</code>"). This will - build the Makefile for the server itself, and update the - <code>src/modules/Makefile</code> for any additional modules - you have requested from beneath that subdirectory.</li> - - <li>Make the server (run "<code>make</code>" in the - <code>src</code> directory).</li> + <li>Make the server (run "<code>make</code>").</li> </ol> <p>To add another module of your own:</p> <ol type="A"> - <li><code>mkdir src/modules/<em>mymodule</em></code></li> + <li><code>cp modules/experimental/mod_example.c + modules/new_module/<em>mod_myexample.c</em></code></li> + + <li>Modify the file.</li> + + <li>Create <code>modules/new_module/config.m4</code>. + <ol> + <li>Add <code>APACHE_MODPATH_INIT(new_module)</code>.</li> + <li>Copy APACHE_MODULE line with "example" from + <code>modules/experimental/config.m4</code>.</li> + <li>Replace the first argument "example" with <em>myexample</em>.</li> + <li>Replace the second argument with brief description of your module. + It will be used in <code>configure --help</code>.</li> + <li>If your module needs additional C compiler flags, linker flags or + libraries, add them to CFLAGS, LDFLAGS and LIBS accordingly. + See other <code>config.m4</code> files in modules directory for + examples.</li> + <li>Add <code>APACHE_MODPATH_FINISH</code>.</li> + </ol> + </li> + + <li>Create <code>module/new_module/Makefile.in</code>. + If your module doesn't need special build instructions, + all you need to have in that file is + <code>include $(top_srcdir)/build/special.mk</code>.</li> - <li><code>cp src/modules/example/* - src/modules/<em>mymodule</em></code></li> + <li>Run ./buildconf from the top-level directory.</li> - <li>Modify the files in the new directory.</li> + <li>Build the server with --enable-myexample</li> - <li>Follow steps [1] through [3] above, with appropriate - changes.</li> </ol> </section> <section id="using"><title>Using the <code>mod_example</code> Module</title> <p>To activate the example module, include a block similar to - the following in your <code>srm.conf</code> file:</p> + the following in your <code>httpd.conf</code> file:</p> <example> <Location /example-info><br /> SetHandler example-handler<br /> |