]> granicus.if.org Git - apache/commitdiff
Update documentation to include stuff for mod_example.
authorKen Coar <coar@apache.org>
Fri, 11 Apr 1997 22:23:26 +0000 (22:23 +0000)
committerKen Coar <coar@apache.org>
Fri, 11 Apr 1997 22:23:26 +0000 (22:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@77852 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/directives.html
docs/manual/mod/index.html
docs/manual/mod/mod_example.html [new file with mode: 0644]

index cdcbd95e895e247127a1f3c78254c7672aa81c43..cf18af1a58c182777d1765dd2ac3e7ac86a0dad4 100644 (file)
@@ -67,6 +67,7 @@
 <li><A HREF="core.html#documentroot">DocumentRoot</A>
 <li><A HREF="core.html#errordocument">ErrorDocument</A>
 <li><A HREF="core.html#errorlog">ErrorLog</A>
+<li><A HREF="mod_example.html#example">Example</A>
 <li><A HREF="mod_expires.html#expiresactive">ExpiresActive</A>
 <li><A HREF="mod_expires.html#expiresbytype">ExpiresByType</A>
 <li><A HREF="mod_expires.html#expiresdefault">ExpiresDefault</A>
index 86f0619ca64c5407a8262c4a7db6398505d027d3..b2185ab18a7041062b9915d4c4dd1340874eec76 100644 (file)
@@ -46,6 +46,8 @@ mod_usertrack
 <dd>Start-time linking with the GNU libdld.
 <dt><A HREF="mod_env.html">mod_env</A>
 <dd>Passing of environments to CGI scripts
+<dt><A HREF="mod_example.html">mod_example</A> Apache 1.2 and up
+<dd>Demonstrates Apache API
 <dt><A HREF="mod_expires.html">mod_expires</A> Apache 1.2 and up
 <dd>Apply Expires: headers to resources
 <dt><A HREF="mod_headers.html">mod_headers</A> Apache 1.2 and up
diff --git a/docs/manual/mod/mod_example.html b/docs/manual/mod/mod_example.html
new file mode 100644 (file)
index 0000000..05fb8ef
--- /dev/null
@@ -0,0 +1,133 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<HTML>
+ <HEAD>
+  <TITLE>Apache module mod_example</TITLE>
+ </HEAD>
+ <BODY>
+  <!--#include virtual="header.html" -->
+  <H1>Module mod_example</h1>
+  <P>
+  This module is contained in the <CODE>modules/mod_example.c</CODE> file, and
+  <STRONG>is not</STRONG> compiled in by default.  It illustrates many of
+  the aspects of the
+  <A
+   HREF="../misc/API.html"
+   REL="Help"
+  >Apache 1.2 API</A>
+  and, when used, demonstrates the manner in which module callbacks are
+  triggered by the server.
+  </P>
+  <H2>Summary</H2>
+  <P>
+  The files in the <CODE>src/modules/example directory</CODE> under the
+  Apache distribution directory tree are provided as an example to those
+  that wish to write modules that use the Apache API.
+  </P>
+  <P>
+  The main file is <CODE>mod_example.c</CODE>, which illustrates all
+  the different callback mechanisms and call syntaces.  By no means does
+  an add-on module need to include routines for all of the callbacks -
+  quite the contrary!
+  </P>
+  <P>
+  The example module is an actual working module.  If you link it into
+  your server, enable the "example-handler" handler for a location, and
+  then browse to that location, you will see a display of
+  some of the tracing the example module did as the various callbacks
+  were made.
+  </P>
+  <P>
+  To include the example module in your server, follow the steps below:
+  </P>
+  <OL>
+   <LI>Uncomment the "Module example_module" line near the bottom of
+    the <CODE>src/Configuration</CODE> file.  If there isn't one, add
+    it; it should look like this:
+    <PRE>
+     Module example_module        modules/example/mod_example.o
+    </PRE>
+   </LI>
+   <LI>Run the <CODE>src/Configure</CODE> script
+    ("<SAMP>cd&nbsp;src;&nbsp;./Configure</SAMP>").  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 "<SAMP>make</SAMP>" in the <CODE>src</CODE>
+    directory).
+   </LI>
+  </OL>
+  <P>
+  To add another module of your own:
+  </P>
+  <OL TYPE="A">
+   <LI><SAMP>mkdir src/modules/<EM>mymodule</EM></SAMP>
+   </LI>
+   <LI><SAMP>cp src/modules/example/* src/modules/<EM>mymodule</EM></SAMP>
+   </LI>
+   <LI>Modify the files in the new directory.
+   </LI>
+   <LI>Follow steps [1] through [3] above, with appropriate changes.
+   </LI>
+  </OL>
+  <H3>
+   Using the <SAMP>mod_example</SAMP> Module
+  </H3>
+  <P>
+  To activate the example module, include a block similar to the
+  following in your <SAMP>srm.conf</SAMP> file:
+  </P>
+  <PRE>
+   &lt;Location /example-info&gt;
+       SetHandler example-handler
+   &lt;/Location&gt;
+  </PRE>
+  <P>
+  As an alternative, you can put the following into a
+  <A
+   HREF="core.html#accessfilename"
+  ><SAMP>.htaccess</SAMP></A>
+  file and then request the file &quot;test.example&quot; from that
+  location:
+  </P>
+  <PRE>
+   AddHandler example-handler .example
+  </PRE>
+  <P>
+  After reloading/restarting your server, you should be able to browse
+  to this location and see the brief display mentioned earlier.
+  </P>
+  <H2>Directives</H2>
+  <P>
+  <UL>
+   <LI><A HREF="#example">Example</A>
+   </LI>
+  </UL>
+  </P>
+  <HR>
+  <A NAME="example">
+   <H2>Example</H2>
+  </A>
+  <P>
+  <STRONG>Syntax:</STRONG> Example
+  <BR>
+  <STRONG>Default:</STRONG> None
+  <BR>
+  <STRONG>Context:</STRONG> server config, virtual host, directory, .htaccess
+  <BR>
+  <STRONG>Override:</STRONG> Options
+  <BR>
+  <STRONG>Status:</STRONG> Extension
+  <BR>
+  <STRONG>Module:</STRONG> mod_example
+  </P>
+  <P>
+  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.
+  </P>
+  <!--#include virtual="footer.html" -->
+ </BODY>
+</HTML>