]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_filter.html.en
Missing </section> tag from whenever this was last modified.
[apache] / docs / manual / mod / mod_filter.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_filter - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <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>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_filter</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_filter.html" title="English">&nbsp;en&nbsp;</a></p>
25 </div>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Context-sensitive smart filter configuration module</td></tr>
27 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
28 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>filter_module</td></tr>
29 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_filter.c</td></tr>
30 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.1 and later</td></tr></table>
31 <h3>Summary</h3>
32
33     <p>This module enables smart, context-sensitive configuration of
34     output content filters.  For example, apache can be configured to
35     process different content-types through different filters, even
36     when the content-type is not known in advance (e.g. in a proxy).</p>
37
38     <p><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> works by introducing indirection into
39     the filter chain.  Instead of inserting filters in the chain, we insert
40     a filter harness which in turn dispatches conditionally
41     to a filter provider.  Any content filter may be used as a provider
42     to <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>; no change to existing filter modules is
43     required (although it may be possible to simplify them).</p>
44 </div>
45 <div id="quickview"><h3 class="directives">Directives</h3>
46 <ul id="toc">
47 <li><img alt="" src="../images/down.gif" /> <a href="#filterchain">FilterChain</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#filterdeclare">FilterDeclare</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#filterprotocol">FilterProtocol</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#filterprovider">FilterProvider</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#filtertrace">FilterTrace</a></li>
52 </ul>
53 <h3>Topics</h3>
54 <ul id="topics">
55 <li><img alt="" src="../images/down.gif" /> <a href="#smart">Smart Filtering</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#terms">Filter Declarations, Providers and Chains</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#config">Configuring the Chain</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#errordocs">Filtering and Response Status</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#upgrade">Upgrading from HTTPD 2.2 Configuration</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#protocol">Protocol Handling</a></li>
62 </ul></div>
63 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
64 <div class="section">
65 <h2><a name="smart" id="smart">Smart Filtering</a></h2>
66     <p>In the traditional filtering model, filters are inserted unconditionally
67     using <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code> and family.
68     Each filter then needs to determine whether to run, and there is little
69     flexibility available for server admins to allow the chain to be
70     configured dynamically.</p>
71
72     <p><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> by contrast gives server administrators a
73     great deal of flexibility in configuring the filter chain.  In fact,
74     filters can be inserted based on any Request Header, Response Header
75     or Environment Variable.  This generalises the limited flexibility offered
76     by <code class="directive"><a href="../mod/core.html#addoutputfilterbytype">AddOutputFilterByType</a></code>, and fixes
77     it to work correctly with dynamic content, regardless of the
78     content generator.  The ability to dispatch based on Environment
79     Variables offers the full flexibility of configuration with
80     <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> to anyone who needs it.</p>
81 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
82 <div class="section">
83 <h2><a name="terms" id="terms">Filter Declarations, Providers and Chains</a></h2>
84     <p class="figure">
85     <img src="../images/mod_filter_old.gif" width="160" height="310" alt="[This image displays the traditional filter model]" /><br />
86     <dfn>Figure 1:</dfn> The traditional filter model</p>
87
88     <p>In the traditional model, output filters are a simple chain
89     from the content generator (handler) to the client.  This works well
90     provided the filter chain can be correctly configured, but presents
91     problems when the filters need to be configured dynamically based on
92     the outcome of the handler.</p>
93
94     <p class="figure">
95     <img src="../images/mod_filter_new.gif" width="423" height="331" alt="[This image shows the mod_filter model]" /><br />
96     <dfn>Figure 2:</dfn> The <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> model</p>
97
98     <p><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> works by introducing indirection into
99     the filter chain.  Instead of inserting filters in the chain, we insert
100     a filter harness which in turn dispatches conditionally
101     to a filter provider.  Any content filter may be used as a provider
102     to <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>; no change to existing filter modules
103     is required (although it may be possible to simplify them).  There can be
104     multiple providers for one filter, but no more than one provider will
105     run for any single request.</p>
106
107     <p>A filter chain comprises any number of instances of the filter
108     harness, each of which may have any number of providers.  A special
109     case is that of a single provider with unconditional dispatch: this
110     is equivalent to inserting the provider filter directly into the chain.</p>
111 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
112 <div class="section">
113 <h2><a name="config" id="config">Configuring the Chain</a></h2>
114     <p>There are three stages to configuring a filter chain with
115     <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>. For details of the directives, see below.</p>
116
117     <dl>
118     <dt>Declare Filters</dt>
119     <dd>The <code class="directive"><a href="#filterdeclare">FilterDeclare</a></code> directive
120     declares a filter, assigning it a name and filter type.  Required
121     only if the filter is not the default type AP_FTYPE_RESOURCE.</dd>
122
123     <dt>Register Providers</dt>
124     <dd>The <code class="directive"><a href="#filterprovider">FilterProvider</a></code>
125     directive registers a provider with a filter. The filter may have
126     been declared with <code class="directive"><a href="#filterdeclare">FilterDeclare</a></code>; if not, FilterProvider will implicitly
127     declare it with the default type AP_FTYPE_RESOURCE. The provider
128     must have been
129     registered with <code>ap_register_output_filter</code> by some module.
130     The final argument to <code class="directive"><a href="#filterprovider">FilterProvider</a></code> is an expression: the provider will be
131     selected to run for a request if and only if the expression evaluates
132     to true.  The expression may evaluate HTTP request or response
133     headers, environment variables, or the Handler used by this request.
134     Unlike earlier versions, mod_filter now supports complex expressions
135     involving multiple criteria with AND / OR logic (&amp;&amp; / ||)
136     and brackets.</dd>
137
138     <dt>Configure the Chain</dt>
139     <dd>The above directives build components of a smart filter chain,
140     but do not configure it to run.  The <code class="directive"><a href="#filterchain">FilterChain</a></code> directive builds a filter chain from smart
141     filters declared, offering the flexibility to insert filters at the
142     beginning or end of the chain, remove a filter, or clear the chain.</dd>
143 </dl>
144 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
145 <div class="section">
146 <h2><a name="errordocs" id="errordocs">Filtering and Response Status</a></h2>
147     <p>mod_filter normally only runs filters on responses with
148     HTTP status 200 (OK).  If you want to filter documents with
149     other response statuses, you can set the <var>filter-errordocs</var>
150     environment variable, and it will work on all responses
151     regardless of status.  To refine this further, you can use
152     expression conditions with <code class="directive">FilterProvider</code>.</p>
153 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
154 <div class="section">
155 <h2><a name="upgrade" id="upgrade">Upgrading from HTTPD 2.2 Configuration</a></h2>
156     <p>The <code class="directive"><a href="#filterprovider">FilterProvider</a></code>
157     directive has changed from HTTPD 2.2: the <var>match</var> and
158     <var>dispatch</var> arguments are replaced with a single but
159     more versatile <var>expression</var>.  In general, you can convert
160     a match/dispatch pair to the two sides of an expression, using
161     something like:</p>
162     <div class="example"><p><code>"dispatch = match"</code></p></div>
163     <p>The Request headers, Response headers and Environment variables
164     are now interpreted from syntax <var>$req{foo}</var>,
165     <var>$resp{foo}</var> and <var>$env{foo}</var> respectively.
166     The variables <var>$handler</var> and <var>$Content-Type</var>
167     are also supported.</p>
168     <p>Note that the match no longer supports integer comparisons
169     or substring matches.  The latter can be replaced by regular
170     expression matches.</p>
171 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
172 <div class="section">
173 <h2><a name="examples" id="examples">Examples</a></h2>
174     <dl>
175     <dt>Server side Includes (SSI)</dt>
176     <dd>A simple case of using <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> in place of
177     <code class="directive"><a href="../mod/core.html#addoutputfilterbytype">AddOutputFilterByType</a></code>
178     <div class="example"><p><code>
179       FilterDeclare SSI<br />
180       FilterProvider SSI INCLUDES "$resp{Content-Type} = /^text\/html/"<br />
181       FilterChain SSI
182     </code></p></div>
183     </dd>
184
185     <dt>Server side Includes (SSI)</dt>
186     <dd>The same as the above but dispatching on handler (classic
187     SSI behaviour; .shtml files get processed).
188     <div class="example"><p><code>
189       FilterProvider SSI INCLUDES "Handler = server-parsed"<br />
190       FilterChain SSI
191     </code></p></div>
192     </dd>
193
194     <dt>Emulating mod_gzip with mod_deflate</dt>
195     <dd>Insert INFLATE filter only if "gzip" is NOT in the
196     Accept-Encoding header.  This filter runs with ftype CONTENT_SET.
197     <div class="example"><p><code>
198       FilterDeclare gzip CONTENT_SET<br />
199       FilterProvider gzip inflate "$req{Accept-Encoding} != /gzip/"<br />
200       FilterChain gzip
201     </code></p></div>
202     </dd>
203
204     <dt>Image Downsampling</dt>
205     <dd>Suppose we want to downsample all web images, and have filters
206     for GIF, JPEG and PNG.
207     <div class="example"><p><code>
208       FilterProvider unpack jpeg_unpack "$resp{Content-Type} = image/jpeg"<br />
209       FilterProvider unpack gif_unpack "$resp{Content-Type} = image/gif"<br />
210       FilterProvider unpack png_unpack "$resp{Content-Type} = image/png"<br />
211       <br />
212       FilterProvider downsample downsample_filter "$resp{Content-Type} = /image\/(jpeg|gif|png)/"<br />
213       FilterProtocol downsample "change=yes"<br />
214       <br />
215       FilterProvider repack jpeg_pack "$resp{Content-Type} = image/jpeg"<br />
216       FilterProvider repack gif_pack "$resp{Content-Type} = image/gif"<br />
217       FilterProvider repack png_pack "$resp{Content-Type} = image/png"<br />
218       &lt;Location /image-filter&gt;<br />
219       <span class="indent">
220         FilterChain unpack downsample repack<br />
221       </span>
222       &lt;/Location&gt;
223     </code></p></div>
224     </dd>
225     </dl>
226 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
227 <div class="section">
228 <h2><a name="protocol" id="protocol">Protocol Handling</a></h2>
229     <p>Historically, each filter is responsible for ensuring that whatever
230     changes it makes are correctly represented in the HTTP response headers,
231     and that it does not run when it would make an illegal change.  This
232     imposes a burden on filter authors to re-implement some common
233     functionality in every filter:</p>
234
235     <ul>
236     <li>Many filters will change the content, invalidating existing content
237     tags, checksums, hashes, and lengths.</li>
238
239     <li>Filters that require an entire, unbroken response in input need to
240     ensure they don't get byteranges from a backend.</li>
241
242     <li>Filters that transform output in a filter need to ensure they don't
243     violate a <code>Cache-Control: no-transform</code> header from the
244     backend.</li>
245
246     <li>Filters may make responses uncacheable.</li>
247     </ul>
248
249     <p><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> aims to offer generic handling of these
250     details of filter implementation, reducing the complexity required of
251     content filter modules. This is work-in-progress; the
252     <code class="directive"><a href="#filterprotocol">FilterProtocol</a></code> implements
253     some of this functionality for back-compatibility with Apache 2.0
254     modules.  For httpd 2.1 and later, the
255     <code>ap_register_output_filter_protocol</code> and
256     <code>ap_filter_protocol</code> API enables filter modules to
257     declare their own behaviour.</p>
258
259     <p>At the same time, <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> should not interfere
260     with a filter that wants to handle all aspects of the protocol.  By
261     default (i.e. in the absence of any <code class="directive"><a href="#filterprotocol">FilterProtocol</a></code> directives), <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>
262     will leave the headers untouched.</p>
263
264     <p>At the time of writing, this feature is largely untested,
265     as modules in common use are designed to work with 2.0.
266     Modules using it should test it carefully.</p>
267 </div>
268 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
269 <div class="directive-section"><h2><a name="FilterChain" id="FilterChain">FilterChain</a> <a name="filterchain" id="filterchain">Directive</a></h2>
270 <table class="directive">
271 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configure the filter chain</td></tr>
272 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterChain [+=-@!]<var>filter-name</var> <var>...</var></code></td></tr>
273 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
274 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
275 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
276 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr>
277 </table>
278     <p>This configures an actual filter chain, from declared filters.
279     <code class="directive">FilterChain</code> takes any number of arguments,
280     each optionally preceded with a single-character control that
281     determines what to do:</p>
282
283     <dl>
284     <dt><code>+<var>filter-name</var></code></dt>
285     <dd>Add <var>filter-name</var> to the end of the filter chain</dd>
286
287     <dt><code>@<var>filter-name</var></code></dt>
288     <dd>Insert <var>filter-name</var> at the start of the filter chain</dd>
289
290     <dt><code>-<var>filter-name</var></code></dt>
291     <dd>Remove <var>filter-name</var> from the filter chain</dd>
292
293     <dt><code>=<var>filter-name</var></code></dt>
294     <dd>Empty the filter chain and insert <var>filter-name</var></dd>
295
296     <dt><code>!</code></dt>
297     <dd>Empty the filter chain</dd>
298
299     <dt><code><var>filter-name</var></code></dt>
300     <dd>Equivalent to <code>+<var>filter-name</var></code></dd>
301     </dl>
302
303 </div>
304 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
305 <div class="directive-section"><h2><a name="FilterDeclare" id="FilterDeclare">FilterDeclare</a> <a name="filterdeclare" id="filterdeclare">Directive</a></h2>
306 <table class="directive">
307 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Declare a smart filter</td></tr>
308 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterDeclare <var>filter-name</var> <var>[type]</var></code></td></tr>
309 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
310 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
311 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
312 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr>
313 </table>
314     <p>This directive declares an output filter together with a
315     header or environment variable that will determine runtime
316     configuration.  The first argument is a <var>filter-name</var>
317     for use in <code class="directive"><a href="#filterprovider">FilterProvider</a></code>,
318     <code class="directive"><a href="#filterchain">FilterChain</a></code> and
319     <code class="directive"><a href="#filterprotocol">FilterProtocol</a></code> directives.</p>
320
321     <p>The final (optional) argument
322     is the type of filter, and takes values of <code>ap_filter_type</code>
323     - namely <code>RESOURCE</code> (the default), <code>CONTENT_SET</code>,
324     <code>PROTOCOL</code>, <code>TRANSCODE</code>, <code>CONNECTION</code>
325     or <code>NETWORK</code>.</p>
326
327 </div>
328 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
329 <div class="directive-section"><h2><a name="FilterProtocol" id="FilterProtocol">FilterProtocol</a> <a name="filterprotocol" id="filterprotocol">Directive</a></h2>
330 <table class="directive">
331 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Deal with correct HTTP protocol handling</td></tr>
332 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterProtocol <var>filter-name</var> [<var>provider-name</var>]
333     <var>proto-flags</var></code></td></tr>
334 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
335 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
336 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
337 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr>
338 </table>
339     <p>This directs <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> to deal with ensuring the
340     filter doesn't run when it shouldn't, and that the HTTP response
341     headers are correctly set taking into account the effects of the
342     filter.</p>
343
344     <p>There are two forms of this directive.  With three arguments, it
345     applies specifically to a <var>filter-name</var> and a
346     <var>provider-name</var> for that filter.
347     With two arguments it applies to a <var>filter-name</var> whenever the
348     filter runs <em>any</em> provider.</p>
349
350     <p><var>proto-flags</var> is one or more of</p>
351
352     <dl>
353     <dt><code>change=yes</code></dt>
354     <dd>The filter changes the content, including possibly the content
355     length</dd>
356
357     <dt><code>change=1:1</code></dt>
358     <dd>The filter changes the content, but will not change the content
359     length</dd>
360
361     <dt><code>byteranges=no</code></dt>
362     <dd>The filter cannot work on byteranges and requires complete input</dd>
363
364     <dt><code>proxy=no</code></dt>
365     <dd>The filter should not run in a proxy context</dd>
366
367     <dt><code>proxy=transform</code></dt>
368     <dd>The filter transforms the response in a manner incompatible with
369     the HTTP <code>Cache-Control: no-transform</code> header.</dd>
370
371     <dt><code>cache=no</code></dt>
372     <dd>The filter renders the output uncacheable (eg by introducing randomised
373     content changes)</dd>
374     </dl>
375
376 </div>
377 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
378 <div class="directive-section"><h2><a name="FilterProvider" id="FilterProvider">FilterProvider</a> <a name="filterprovider" id="filterprovider">Directive</a></h2>
379 <table class="directive">
380 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Register a content filter</td></tr>
381 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterProvider <var>filter-name</var> <var>provider-name</var>
382  <var>expression</var></code></td></tr>
383 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
384 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
385 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
386 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr>
387 </table>
388     <p>This directive registers a <em>provider</em> for the smart filter.
389     The provider will be called if and only if the <var>expression</var>
390     declared evaluates to true when the harness is first called.</p>
391
392     <p>
393     <var>provider-name</var> must have been registered by loading
394     a module that registers the name with
395     <code>ap_register_output_filter</code>.
396     </p>
397
398     <p><var>expression</var> can be any of the following:</p>
399     <dl>
400       <dt><code><var>string</var></code></dt>
401       <dd>true if <var>string</var> is not empty</dd>
402
403       <dt><code><var>string1</var> = <var>string2</var><br />
404       <var>string1</var> == <var>string2</var><br />
405       <var>string1</var> != <var>string2</var></code></dt>
406
407       <dd><p>Compare <var>string1</var> with <var>string2</var>. If
408       <var>string2</var> has the form <code>/<var>string2</var>/</code>
409       then it is treated as a regular expression. Regular expressions are
410       implemented by the <a href="http://www.pcre.org">PCRE</a> engine and
411       have the same syntax as those in <a href="http://www.perl.com">perl
412       5</a>. Note that <code>==</code> is just an alias for <code>=</code>
413       and behaves exactly the same way.</p>
414       </dd>
415
416       <dt><code><var>string1</var> &lt; <var>string2</var><br />
417        <var>string1</var> &lt;= <var>string2</var><br />
418        <var>string1</var> &gt; <var>string2</var><br />
419        <var>string1</var> &gt;= <var>string2</var></code></dt>
420
421       <dd>Compare <var>string1</var> with <var>string2</var>. Note, that
422       strings are compared <em>literally</em> (using
423       <code>strcmp(3)</code>). Therefore the string "100" is less than
424       "20".</dd>
425
426       <dt><code>( <var>expression</var> )</code></dt>
427       <dd>true if <var>expression</var> is true</dd>
428
429       <dt><code>! <var>expression</var></code></dt>
430       <dd>true if <var>expression</var> is false</dd>
431
432       <dt><code><var>expression1</var> &amp;&amp;
433         <var>expression2</var></code></dt>
434       <dd>true if both <var>expression1</var> and
435       <var>expression2</var> are true</dd>
436
437       <dt><code><var>expression1</var> ||
438         <var>expression2</var></code></dt>
439       <dd>true if either <var>expression1</var> or
440       <var>expression2</var> is true</dd>
441     </dl>
442
443
444 </div>
445 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
446 <div class="directive-section"><h2><a name="FilterTrace" id="FilterTrace">FilterTrace</a> <a name="filtertrace" id="filtertrace">Directive</a></h2>
447 <table class="directive">
448 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Get debug/diagnostic information from
449     <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code></td></tr>
450 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterTrace <var>filter-name</var> <var>level</var></code></td></tr>
451 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
452 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
453 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr>
454 </table>
455     <p>This directive generates debug information from
456     <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>.
457     It is designed to help test and debug providers (filter modules), although
458     it may also help with <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> itself.</p>
459
460     <p>The debug output depends on the <var>level</var> set:</p>
461     <dl>
462     <dt><code>0</code> (default)</dt>
463     <dd>No debug information is generated.</dd>
464
465     <dt><code>1</code></dt>
466     <dd><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code> will record buckets and brigades
467     passing through the filter to the error log, before the provider has
468     processed them. This is similar to the information generated by
469     <a href="http://apache.webthing.com/mod_diagnostics/">mod_diagnostics</a>.
470     </dd>
471
472     <dt><code>2</code> (not yet implemented)</dt>
473     <dd>Will dump the full data passing through to a tempfile before the
474     provider. <strong>For single-user debug only</strong>; this will not
475     support concurrent hits.</dd>
476     </dl>
477
478 </div>
479 </div>
480 <div class="bottomlang">
481 <p><span>Available Languages: </span><a href="../en/mod/mod_filter.html" title="English">&nbsp;en&nbsp;</a></p>
482 </div><div id="footer">
483 <p class="apache">Copyright 2009 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>
484 <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>
485 </body></html>