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" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p> 19<p class="apache">Apache HTTP Server Version 2.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache Module mod_filter</h1> 26<div class="toplang"> 27<p><span>Available Languages: </span><a href="/en/mod/mod_filter.html" title="English"> en </a></p> 28</div> 29<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Context-sensitive smart filter configuration module</td></tr> 30<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr> 31<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>filter_module</td></tr> 32<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_filter.c</td></tr> 33<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.1 and later</td></tr></table> 34<h3>Summary</h3> 35 36 <p>This module enables smart, context-sensitive configuration of 37 output content filters. For example, apache can be configured to 38 process different content-types through different filters, even 39 when the content-type is not known in advance (e.g. in a proxy).</p> 40 41 <p><code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> works by introducing indirection into 42 the filter chain. Instead of inserting filters in the chain, we insert 43 a filter harness which in turn dispatches conditionally 44 to a filter provider. Any content filter may be used as a provider 45 to <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code>; no change to existing filter modules is 46 required (although it may be possible to simplify them).</p> 47</div> 48<div id="quickview"><h3 class="directives">Directives</h3> 49<ul id="toc"> 50<li><img alt="" src="/images/down.gif" /> <a href="#filterchain">FilterChain</a></li> 51<li><img alt="" src="/images/down.gif" /> <a href="#filterdeclare">FilterDeclare</a></li> 52<li><img alt="" src="/images/down.gif" /> <a href="#filterprotocol">FilterProtocol</a></li> 53<li><img alt="" src="/images/down.gif" /> <a href="#filterprovider">FilterProvider</a></li> 54<li><img alt="" src="/images/down.gif" /> <a href="#filtertrace">FilterTrace</a></li> 55</ul> 56<h3>Topics</h3> 57<ul id="topics"> 58<li><img alt="" src="/images/down.gif" /> <a href="#smart">Smart Filtering</a></li> 59<li><img alt="" src="/images/down.gif" /> <a href="#terms">Filter Declarations, Providers and Chains</a></li> 60<li><img alt="" src="/images/down.gif" /> <a href="#config">Configuring the Chain</a></li> 61<li><img alt="" src="/images/down.gif" /> <a href="#errordocs">Filtering and Response Status</a></li> 62<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</a></li> 63<li><img alt="" src="/images/down.gif" /> <a href="#protocol">Protocol Handling</a></li> 64</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 65<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 66<div class="section"> 67<h2><a name="smart" id="smart">Smart Filtering</a></h2> 68 <p>In the traditional filtering model, filters are inserted unconditionally 69 using <code class="directive"><a href="/mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code> and family. 70 Each filter then needs to determine whether to run, and there is little 71 flexibility available for server admins to allow the chain to be 72 configured dynamically.</p> 73 74 <p><code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> by contrast gives server administrators a 75 great deal of flexibility in configuring the filter chain. In fact, 76 filters can be inserted based on any Request Header, Response Header 77 or Environment Variable. This generalises the limited flexibility offered 78 by <code class="directive"><a href="/mod/core.html#addoutputfilterbytype">AddOutputFilterByType</a></code>, and fixes 79 it to work correctly with dynamic content, regardless of the 80 content generator. The ability to dispatch based on Environment 81 Variables offers the full flexibility of configuration with 82 <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> to anyone who needs it.</p> 83</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 84<div class="section"> 85<h2><a name="terms" id="terms">Filter Declarations, Providers and Chains</a></h2> 86 <p class="figure"> 87 <img src="/images/mod_filter_old.gif" width="160" height="310" alt="[This image displays the traditional filter model]" /><br /> 88 <dfn>Figure 1:</dfn> The traditional filter model</p> 89 90 <p>In the traditional model, output filters are a simple chain 91 from the content generator (handler) to the client. This works well 92 provided the filter chain can be correctly configured, but presents 93 problems when the filters need to be configured dynamically based on 94 the outcome of the handler.</p> 95 96 <p class="figure"> 97 <img src="/images/mod_filter_new.gif" width="423" height="331" alt="[This image shows the mod_filter model]" /><br /> 98 <dfn>Figure 2:</dfn> The <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> model</p> 99 100 <p><code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> works by introducing indirection into 101 the filter chain. Instead of inserting filters in the chain, we insert 102 a filter harness which in turn dispatches conditionally 103 to a filter provider. Any content filter may be used as a provider 104 to <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code>; no change to existing filter modules 105 is required (although it may be possible to simplify them). There can be 106 multiple providers for one filter, but no more than one provider will 107 run for any single request.</p> 108 109 <p>A filter chain comprises any number of instances of the filter 110 harness, each of which may have any number of providers. A special 111 case is that of a single provider with unconditional dispatch: this 112 is equivalent to inserting the provider filter directly into the chain.</p> 113</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 114<div class="section"> 115<h2><a name="config" id="config">Configuring the Chain</a></h2> 116 <p>There are three stages to configuring a filter chain with 117 <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code>. For details of the directives, see below.</p> 118 119 <dl> 120 <dt>Declare Filters</dt> 121 <dd>The <code class="directive"><a href="#filterdeclare">FilterDeclare</a></code> directive 122 declares a filter, assigning it a name and filter type. Required 123 only if the filter is not the default type AP_FTYPE_RESOURCE.</dd> 124 125 <dt>Register Providers</dt> 126 <dd>The <code class="directive"><a href="#filterprovider">FilterProvider</a></code> 127 directive registers a provider with a filter. The filter may have 128 been declared with <code class="directive"><a href="#filterdeclare">FilterDeclare</a></code>; if not, FilterProvider will implicitly 129 declare it with the default type AP_FTYPE_RESOURCE. The provider 130 must have been 131 registered with <code>ap_register_output_filter</code> by some module. 132 The remaining arguments to <code class="directive"><a href="#filterprovider">FilterProvider</a></code> are a dispatch criterion and a match string. 133 The former may be an HTTP request or response header, an environment 134 variable, or the Handler used by this request. The latter is matched 135 to it for each request, to determine whether this provider will be 136 used to implement the filter for this request.</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="examples" id="examples">Examples</a></h2> 156 <dl> 157 <dt>Server side Includes (SSI)</dt> 158 <dd>A simple case of using <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> in place of 159 <code class="directive"><a href="/mod/core.html#addoutputfilterbytype">AddOutputFilterByType</a></code> 160 <div class="example"><p><code> 161 FilterDeclare SSI<br /> 162 FilterProvider SSI INCLUDES resp=Content-Type $text/html<br /> 163 FilterChain SSI 164 </code></p></div> 165 </dd> 166 167 <dt>Server side Includes (SSI)</dt> 168 <dd>The same as the above but dispatching on handler (classic 169 SSI behaviour; .shtml files get processed). 170 <div class="example"><p><code> 171 FilterProvider SSI INCLUDES Handler server-parsed<br /> 172 FilterChain SSI 173 </code></p></div> 174 </dd> 175 176 <dt>Emulating mod_gzip with mod_deflate</dt> 177 <dd>Insert INFLATE filter only if "gzip" is NOT in the 178 Accept-Encoding header. This filter runs with ftype CONTENT_SET. 179 <div class="example"><p><code> 180 FilterDeclare gzip CONTENT_SET<br /> 181 FilterProvider gzip inflate req=Accept-Encoding !$gzip<br /> 182 FilterChain gzip 183 </code></p></div> 184 </dd> 185 186 <dt>Image Downsampling</dt> 187 <dd>Suppose we want to downsample all web images, and have filters 188 for GIF, JPEG and PNG. 189 <div class="example"><p><code> 190 FilterProvider unpack jpeg_unpack Content-Type $image/jpeg<br /> 191 FilterProvider unpack gif_unpack Content-Type $image/gif<br /> 192 FilterProvider unpack png_unpack Content-Type $image/png<br /> 193 <br /> 194 FilterProvider downsample downsample_filter Content-Type $image<br /> 195 FilterProtocol downsample "change=yes"<br /> 196 <br /> 197 FilterProvider repack jpeg_pack Content-Type $image/jpeg<br /> 198 FilterProvider repack gif_pack Content-Type $image/gif<br /> 199 FilterProvider repack png_pack Content-Type $image/png<br /> 200 <Location /image-filter><br /> 201 <span class="indent"> 202 FilterChain unpack downsample repack<br /> 203 </span> 204 </Location> 205 </code></p></div> 206 </dd> 207 </dl> 208</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 209<div class="section"> 210<h2><a name="protocol" id="protocol">Protocol Handling</a></h2> 211 <p>Historically, each filter is responsible for ensuring that whatever 212 changes it makes are correctly represented in the HTTP response headers, 213 and that it does not run when it would make an illegal change. This 214 imposes a burden on filter authors to re-implement some common 215 functionality in every filter:</p> 216 217 <ul> 218 <li>Many filters will change the content, invalidating existing content 219 tags, checksums, hashes, and lengths.</li> 220 221 <li>Filters that require an entire, unbroken response in input need to 222 ensure they don't get byteranges from a backend.</li> 223 224 <li>Filters that transform output in a filter need to ensure they don't 225 violate a <code>Cache-Control: no-transform</code> header from the 226 backend.</li> 227 228 <li>Filters may make responses uncacheable.</li> 229 </ul> 230 231 <p><code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> aims to offer generic handling of these 232 details of filter implementation, reducing the complexity required of 233 content filter modules. This is work-in-progress; the 234 <code class="directive"><a href="#filterprotocol">FilterProtocol</a></code> implements 235 some of this functionality for back-compatibility with Apache 2.0 236 modules. For httpd 2.1 and later, the 237 <code>ap_register_output_filter_protocol</code> and 238 <code>ap_filter_protocol</code> API enables filter modules to 239 declare their own behaviour.</p> 240 241 <p>At the same time, <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> should not interfere 242 with a filter that wants to handle all aspects of the protocol. By 243 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> 244 will leave the headers untouched.</p> 245 246 <p>At the time of writing, this feature is largely untested, 247 as modules in common use are designed to work with 2.0. 248 Modules using it should test it carefully.</p> 249</div> 250<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 251<div class="directive-section"><h2><a name="FilterChain" id="FilterChain">FilterChain</a> <a name="filterchain" id="filterchain">Directive</a></h2> 252<table class="directive"> 253<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configure the filter chain</td></tr> 254<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterChain [+=-@!]<var>filter-name</var> <var>...</var></code></td></tr> 255<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 256<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr> 257<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 258<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr> 259</table> 260 <p>This configures an actual filter chain, from declared filters. 261 <code class="directive">FilterChain</code> takes any number of arguments, 262 each optionally preceded with a single-character control that 263 determines what to do:</p> 264 265 <dl> 266 <dt><code>+<var>filter-name</var></code></dt> 267 <dd>Add <var>filter-name</var> to the end of the filter chain</dd> 268 269 <dt><code>@<var>filter-name</var></code></dt> 270 <dd>Insert <var>filter-name</var> at the start of the filter chain</dd> 271 272 <dt><code>-<var>filter-name</var></code></dt> 273 <dd>Remove <var>filter-name</var> from the filter chain</dd> 274 275 <dt><code>=<var>filter-name</var></code></dt> 276 <dd>Empty the filter chain and insert <var>filter-name</var></dd> 277 278 <dt><code>!</code></dt> 279 <dd>Empty the filter chain</dd> 280 281 <dt><code><var>filter-name</var></code></dt> 282 <dd>Equivalent to <code>+<var>filter-name</var></code></dd> 283 </dl> 284 285</div> 286<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 287<div class="directive-section"><h2><a name="FilterDeclare" id="FilterDeclare">FilterDeclare</a> <a name="filterdeclare" id="filterdeclare">Directive</a></h2> 288<table class="directive"> 289<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Declare a smart filter</td></tr> 290<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterDeclare <var>filter-name</var> <var>[type]</var></code></td></tr> 291<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 292<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr> 293<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 294<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr> 295</table> 296 <p>This directive declares an output filter together with a 297 header or environment variable that will determine runtime 298 configuration. The first argument is a <var>filter-name</var> 299 for use in <code class="directive"><a href="#filterprovider">FilterProvider</a></code>, 300 <code class="directive"><a href="#filterchain">FilterChain</a></code> and 301 <code class="directive"><a href="#filterprotocol">FilterProtocol</a></code> directives.</p> 302 303 <p>The final (optional) argument 304 is the type of filter, and takes values of <code>ap_filter_type</code> 305 - namely <code>RESOURCE</code> (the default), <code>CONTENT_SET</code>, 306 <code>PROTOCOL</code>, <code>TRANSCODE</code>, <code>CONNECTION</code> 307 or <code>NETWORK</code>.</p> 308 309</div> 310<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 311<div class="directive-section"><h2><a name="FilterProtocol" id="FilterProtocol">FilterProtocol</a> <a name="filterprotocol" id="filterprotocol">Directive</a></h2> 312<table class="directive"> 313<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Deal with correct HTTP protocol handling</td></tr> 314<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterProtocol <var>filter-name</var> [<var>provider-name</var>] 315 <var>proto-flags</var></code></td></tr> 316<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 317<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr> 318<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 319<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr> 320</table> 321 <p>This directs <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> to deal with ensuring the 322 filter doesn't run when it shouldn't, and that the HTTP response 323 headers are correctly set taking into account the effects of the 324 filter.</p> 325 326 <p>There are two forms of this directive. With three arguments, it 327 applies specifically to a <var>filter-name</var> and a 328 <var>provider-name</var> for that filter. 329 With two arguments it applies to a <var>filter-name</var> whenever the 330 filter runs <em>any</em> provider.</p> 331 332 <p><var>proto-flags</var> is one or more of</p> 333 334 <dl> 335 <dt><code>change=yes</code></dt> 336 <dd>The filter changes the content, including possibly the content 337 length</dd> 338 339 <dt><code>change=1:1</code></dt> 340 <dd>The filter changes the content, but will not change the content 341 length</dd> 342 343 <dt><code>byteranges=no</code></dt> 344 <dd>The filter cannot work on byteranges and requires complete input</dd> 345 346 <dt><code>proxy=no</code></dt> 347 <dd>The filter should not run in a proxy context</dd> 348 349 <dt><code>proxy=transform</code></dt> 350 <dd>The filter transforms the response in a manner incompatible with 351 the HTTP <code>Cache-Control: no-transform</code> header.</dd> 352 353 <dt><code>cache=no</code></dt> 354 <dd>The filter renders the output uncacheable (eg by introducing randomised 355 content changes)</dd> 356 </dl> 357 358</div> 359<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 360<div class="directive-section"><h2><a name="FilterProvider" id="FilterProvider">FilterProvider</a> <a name="filterprovider" id="filterprovider">Directive</a></h2> 361<table class="directive"> 362<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Register a content filter</td></tr> 363<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterProvider <var>filter-name</var> <var>provider-name</var> 364 [req|resp|env]=<var>dispatch</var> <var>match</var></code></td></tr> 365<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 366<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr> 367<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 368<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr> 369</table> 370 <p>This directive registers a <em>provider</em> for the smart filter. 371 The provider will be called if and only if the <var>match</var> declared 372 here matches the value of the header or environment variable declared 373 as <var>dispatch</var>.</p> 374 375 <p> 376 <var>provider-name</var> must have been registered by loading 377 a module that registers the name with 378 <code>ap_register_output_filter</code>. 379 380 </p> 381 382 <p>The <var>dispatch</var> argument is a string with optional 383 <code>req=</code>, <code>resp=</code> or <code>env=</code> prefix 384 causing it to dispatch on (respectively) the request header, response 385 header, or environment variable named. In the absence of a 386 prefix, it defaults to a response header. A special case is the 387 word <code>handler</code>, which causes <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> 388 to dispatch on the content handler.</p> 389 390 <p>The <var>match</var> argument specifies a match that will be applied to 391 the filter's <var>dispatch</var> criterion. The <var>match</var> may be 392 a string match (exact match or substring), a <a class="glossarylink" href="/glossary.html#regex" title="see glossary">regex</a>, an integer (greater, lessthan or equals), or 393 unconditional. The first characters of the <var>match</var> argument 394 determines this:</p> 395 396 <p><strong>First</strong>, if the first character is an exclamation mark 397 (<code>!</code>), this reverses the rule, so the provider will be used 398 if and only if the match <em>fails</em>.</p> 399 400 <p><strong>Second</strong>, it interprets the first character excluding 401 any leading <code>!</code> as follows:</p> 402 403 <table class="bordered"><tr class="header"><th>Character</th><th>Description</th></tr> 404<tr><td><em>(none)</em></td><td>exact match</td></tr> 405<tr class="odd"><td><code>$</code></td><td>substring match</td></tr> 406<tr><td><code>/</code></td><td>regex match (delimited by a second <code>/</code>)</td></tr> 407<tr class="odd"><td><code>=</code></td><td>integer equality</td></tr> 408<tr><td><code><</code></td><td>integer less-than</td></tr> 409<tr class="odd"><td><code><=</code></td><td>integer less-than or equal</td></tr> 410<tr><td><code>></code></td><td>integer greater-than</td></tr> 411<tr class="odd"><td><code>>=</code></td><td>integer greater-than or equal</td></tr> 412<tr><td><code>*</code></td><td>Unconditional match</td></tr> 413</table> 414 415</div> 416<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 417<div class="directive-section"><h2><a name="FilterTrace" id="FilterTrace">FilterTrace</a> <a name="filtertrace" id="filtertrace">Directive</a></h2> 418<table class="directive"> 419<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Get debug/diagnostic information from 420 <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code></td></tr> 421<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FilterTrace <var>filter-name</var> <var>level</var></code></td></tr> 422<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr> 423<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 424<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_filter</td></tr> 425</table> 426 <p>This directive generates debug information from 427 <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code>. 428 It is designed to help test and debug providers (filter modules), although 429 it may also help with <code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> itself.</p> 430 431 <p>The debug output depends on the <var>level</var> set:</p> 432 <dl> 433 <dt><code>0</code> (default)</dt> 434 <dd>No debug information is generated.</dd> 435 436 <dt><code>1</code></dt> 437 <dd><code class="module"><a href="/mod/mod_filter.html">mod_filter</a></code> will record buckets and brigades 438 passing through the filter to the error log, before the provider has 439 processed them. This is similar to the information generated by 440 <a href="http://apache.webthing.com/mod_diagnostics/">mod_diagnostics</a>. 441 </dd> 442 443 <dt><code>2</code> (not yet implemented)</dt> 444 <dd>Will dump the full data passing through to a tempfile before the 445 provider. <strong>For single-user debug only</strong>; this will not 446 support concurrent hits.</dd> 447 </dl> 448 449</div> 450</div> 451<div class="bottomlang"> 452<p><span>Available Languages: </span><a href="/en/mod/mod_filter.html" title="English"> en </a></p> 453</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 454<script type="text/javascript"><!--//--><![CDATA[//><!-- 455var comments_shortname = 'httpd'; 456var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_filter.html'; 457(function(w, d) { 458 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 459 d.write('<div id="comments_thread"><\/div>'); 460 var s = d.createElement('script'); 461 s.type = 'text/javascript'; 462 s.async = true; 463 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 464 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 465 } 466 else { 467 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 468 } 469})(window, document); 470//--><!]]></script></div><div id="footer"> 471<p class="apache">Copyright 2013 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> 472<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 473if (typeof(prettyPrint) !== 'undefined') { 474 prettyPrint(); 475} 476//--><!]]></script> 477</body></html>