📄 mod_ext_filter.html.en
字号:
# AP_FTYPE_CONTENT_SET will ensure that it is placed<br /> # after mod_deflate.<br /> ExtFilterDefine traceafter \<br /> <span class="indent"> cmd="/bin/tracefilter.pl /tmp/traceafter" \<br /> EnableEnv=trace_this_client ftype=21<br /> </span> <br /> <Directory /usr/local/docs><br /> <span class="indent"> SetEnvIf Remote_Addr 192.168.1.31 trace_this_client<br /> SetOutputFilter tracebefore;deflate;traceafter<br /> </span> </Directory> </code></p></div> <div class="example"><h3>Here is the filter which traces the data:</h3><p><code> #!/usr/local/bin/perl -w<br /> use strict;<br /> <br /> open(SAVE, ">$ARGV[0]")<br /> <span class="indent"> or die "can't open $ARGV[0]: $?";<br /> </span> <br /> while (<STDIN>) {<br /> <span class="indent"> print SAVE $_;<br /> print $_;<br /> </span> }<br /> <br /> close(SAVE); </code></p></div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="ExtFilterDefine" id="ExtFilterDefine">ExtFilterDefine</a> <a name="extfilterdefine" id="extfilterdefine">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define an external filter</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExtFilterDefine <var>filtername</var> <var>parameters</var></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_ext_filter</td></tr></table> <p>The <code class="directive">ExtFilterDefine</code> directive defines the characteristics of an external filter, including the program to run and its arguments.</p> <p><var>filtername</var> specifies the name of the filter being defined. This name can then be used in SetOutputFilter directives. It must be unique among all registered filters. <em>At the present time, no error is reported by the register-filter API, so a problem with duplicate names isn't reported to the user.</em></p> <p>Subsequent parameters can appear in any order and define the external command to run and certain other characteristics. The only required parameter is <code>cmd=</code>. These parameters are:</p> <dl> <dt><code>cmd=<var>cmdline</var></code></dt> <dd>The <code>cmd=</code> keyword allows you to specify the external command to run. If there are arguments after the program name, the command line should be surrounded in quotation marks (<em>e.g.</em>, <code>cmd="<var>/bin/mypgm</var> <var>arg1</var> <var>arg2</var>"</code>. Normal shell quoting is not necessary since the program is run directly, bypassing the shell. Program arguments are blank-delimited. A backslash can be used to escape blanks which should be part of a program argument. Any backslashes which are part of the argument must be escaped with backslash themselves. In addition to the standard CGI environment variables, DOCUMENT_URI, DOCUMENT_PATH_INFO, and QUERY_STRING_UNESCAPED will also be set for the program.</dd> <dt><code>mode=<var>mode</var></code></dt> <dd><code>mode</code> should be <code>output</code> for now (the default). In the future, <code>mode=input</code> will be used to specify a filter for request bodies.</dd> <dt><code>intype=<var>imt</var></code></dt> <dd>This parameter specifies the internet media type (<em>i.e.</em>, MIME type) of documents which should be filtered. By default, all documents are filtered. If <code>intype=</code> is specified, the filter will be disabled for documents of other types.</dd> <dt><code>outtype=<var>imt</var></code></dt> <dd>This parameter specifies the internet media type (<em>i.e.</em>, MIME type) of filtered documents. It is useful when the filter changes the internet media type as part of the filtering operation. By default, the internet media type is unchanged.</dd> <dt><code>PreservesContentLength</code></dt> <dd>The <code>PreservesContentLength</code> keyword specifies that the filter preserves the content length. This is not the default, as most filters change the content length. In the event that the filter doesn't modify the length, this keyword should be specified.</dd> <dt><code>ftype=<var>filtertype</var></code></dt> <dd>This parameter specifies the numeric value for filter type that the filter should be registered as. The default value, AP_FTYPE_RESOURCE, is sufficient in most cases. If the filter needs to operate at a different point in the filter chain than resource filters, then this parameter will be necessary. See the AP_FTYPE_foo definitions in util_filter.h for appropriate values.</dd> <dt><code>disableenv=<var>env</var></code></dt> <dd>This parameter specifies the name of an environment variable which, if set, will disable the filter.</dd> <dt><code>enableenv=<var>env</var></code></dt> <dd>This parameter specifies the name of an environment variable which must be set, or the filter will be disabled.</dd> </dl></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="ExtFilterOptions" id="ExtFilterOptions">ExtFilterOptions</a> <a name="extfilteroptions" id="extfilteroptions">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configure <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code> options</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExtFilterOptions <var>option</var> [<var>option</var>] ...</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ExtFilterOptions DebugLevel=0 NoLogStderr</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_ext_filter</td></tr></table> <p>The <code class="directive">ExtFilterOptions</code> directive specifies special processing options for <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>. <var>Option</var> can be one of</p> <dl> <dt><code>DebugLevel=<var>n</var></code></dt> <dd> The <code>DebugLevel</code> keyword allows you to specify the level of debug messages generated by <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>. By default, no debug messages are generated. This is equivalent to <code>DebugLevel=0</code>. With higher numbers, more debug messages are generated, and server performance will be degraded. The actual meanings of the numeric values are described with the definitions of the DBGLVL_ constants near the beginning of <code>mod_ext_filter.c</code>. <p>Note: The core directive <code class="directive"><a href="../mod/core.html#loglevel">LogLevel</a></code> should be used to cause debug messages to be stored in the Apache error log.</p> </dd> <dt><code>LogStderr | NoLogStderr</code></dt> <dd>The <code>LogStderr</code> keyword specifies that messages written to standard error by the external filter program will be saved in the Apache error log. <code>NoLogStderr</code> disables this feature.</dd> </dl> <div class="example"><h3>Example</h3><p><code> ExtFilterOptions LogStderr DebugLevel=0 </code></p></div> <p>Messages written to the filter's standard error will be stored in the Apache error log. No debug messages will be generated by <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>. </p></div></div><div class="bottomlang"><p><span>Available Languages: </span><a href="../en/mod/mod_ext_filter.html" title="English"> en </a> |<a href="../ko/mod/mod_ext_filter.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p></div><div id="footer"><p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -