Commit a53f2467 authored by Joshua Slive's avatar Joshua Slive
Browse files

Bring mod_ext_filter.html up to the new format.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87123 13f79535-47bb-0310-9956-ffa450edef68
parent 0783c1d2
Loading
Loading
Loading
Loading
+81 −76
Original line number Diff line number Diff line
@@ -14,12 +14,24 @@
<!--#include virtual="header.html" -->
  <H1 ALIGN="CENTER">Module mod_ext_filter</H1>

  <P>
  This module is contained in the <CODE>mod_ext_filter.c</CODE> file, with
  Apache 2.0 and later. It provides the ability to pass the response body
  through an external program before delivering to the client.
  <CODE>mod_ext_filter</CODE> is not compiled into the server by default.
  </P>
  <P>This module provides the ability to pass the response body
  through an external program before delivering to the client.</p>

<p><A
HREF="module-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Experimental
<BR>
<A
HREF="module-dict.html#SourceFile"
REL="Help"
><STRONG>Source File:</STRONG></A> mod_ext_filter.c
<BR>
<A
HREF="module-dict.html#ModuleIdentifier"
REL="Help"
><STRONG>Module Identifier:</STRONG></A> ext_filter_module</p>


  <H2>Summary</H2>
  <P>
@@ -59,6 +71,67 @@
   </LI>
  </UL>


  <H2>Examples</H2>

  <H3>Generating HTML from some other type of response</H3>

  <PRE>
    # mod_ext_filter directive to define a filter to HTML-ize text/c files 
    # using the external program /usr/bin/enscript, with the type of the 
    # result set to text/html
    ExtFilterDefine c-to-html mode=output intype=text/c outtype=text/html \
                    cmd="/usr/bin/enscript --color -W html -Ec -o - -"

    &lt;Directory "/export/home/trawick/apacheinst/htdocs/c"&gt;

    # core directive to cause the new filter to be run on output
    AddOutputFilter c-to-heml

    # mod_mime directive to set the type of .c files to text/c
    AddType text/c .c

    # mod_ext_filter directive to set the debug level just high 
    # enough to see a log message per request showing the configuration
    # in force
    ExtFilterOptions DebugLevel=1

    &lt;/Directory&gt;
  </PRE>

  <H3>Implementing a content encoding filter</H3>

  <PRE>
  # mod_ext_filter directive to define the external filter
  ExtFilterDefine gzip mode=output cmd=/bin/gzip

  &lt;Location /gzipped&gt;

  # core directive to cause the gzip filter to be run on output
  AddOutputFilter gzip

  # mod_header directive to add "Content-Encoding: gzip" header field
  Header set Content-Encoding gzip

  &lt;/Location&gt;
  </PRE>

  <H3>Slowing down the server</H3>
  <PRE>
  # mod_ext_filter directive to define a filter which runs everything 
  # through cat; cat doesn't modify anything; it just introduces extra
  # pathlength and consumes more resources
  ExtFilterDefine slowdown mode=output cmd=/bin/cat preservescontentlength

  &lt;Location /&gt;

  # core directive to cause the slowdown filter to be run several times on 
  # output
  AddOutputFilter slowdown slowdown slowdown

  &lt;/Location&gt;
  </PRE>

  <HR>

  <H2><A NAME="extfilterdefine">ExtFilterDefine</A></H2>
@@ -92,11 +165,6 @@
   HREF="directive-dict.html#Module"
   REL="Help"
  ><STRONG>Module:</STRONG></A> mod_ext_filter
  <BR>
  <A
   HREF="directive-dict.html#Compatibility"
   REL="Help"
  ><STRONG>Compatibility:</STRONG></A> Only available in Apache 2.0 or later

  <P>
  The <CODE>ExtFilterDefine</CODE> directive defines the characteristics of
@@ -148,6 +216,8 @@
  length, this keyword should be specified.
  </DL>

<hr>

  <H2><A NAME="extfilteroptions">ExtFilterOptions</A></H2>
  <P>
  <A
@@ -179,11 +249,6 @@
   HREF="directive-dict.html#Module"
   REL="Help"
  ><STRONG>Module:</STRONG></A> mod_ext_filter
  <BR>
  <A
   HREF="directive-dict.html#Compatibility"
   REL="Help"
  ><STRONG>Compatibility:</STRONG></A> Only available in Apache 2.0 or later

  <P>
  The <CODE>ExtFilterOptions</CODE> directive specifies special processing
@@ -221,66 +286,6 @@

  <P>

  <H2>Examples</H2>

  <H3>Generating HTML from some other type of response</H3>

  <PRE>
    # mod_ext_filter directive to define a filter to HTML-ize text/c files 
    # using the external program /usr/bin/enscript, with the type of the 
    # result set to text/html
    ExtFilterDefine c-to-html mode=output intype=text/c outtype=text/html \
                    cmd="/usr/bin/enscript --color -W html -Ec -o - -"

    &lt;Directory "/export/home/trawick/apacheinst/htdocs/c"&gt;

    # core directive to cause the new filter to be run on output
    AddOutputFilter c-to-heml

    # mod_mime directive to set the type of .c files to text/c
    AddType text/c .c

    # mod_ext_filter directive to set the debug level just high 
    # enough to see a log message per request showing the configuration
    # in force
    ExtFilterOptions DebugLevel=1

    &lt;/Directory&gt;
  </PRE>

  <H3>Implementing a content encoding filter</H3>

  <PRE>
  # mod_ext_filter directive to define the external filter
  ExtFilterDefine gzip mode=output cmd=/bin/gzip

  &lt;Location /gzipped&gt;

  # core directive to cause the gzip filter to be run on output
  AddOutputFilter gzip

  # mod_header directive to add "Content-Encoding: gzip" header field
  Header set Content-Encoding gzip

  &lt;/Location&gt;
  </PRE>

  <H3>Slowing down the server</H3>
  <PRE>
  # mod_ext_filter directive to define a filter which runs everything 
  # through cat; cat doesn't modify anything; it just introduces extra
  # pathlength and consumes more resources
  ExtFilterDefine slowdown mode=output cmd=/bin/cat preservescontentlength

  &lt;Location /&gt;

  # core directive to cause the slowdown filter to be run several times on 
  # output
  AddOutputFilter slowdown slowdown slowdown

  &lt;/Location&gt;
  </PRE>

<!--#include virtual="footer.html" -->
 </BODY>
</HTML>