Loading docs/manual/env.xml +40 −30 Changes for docs/manual/env.xml: 40 added lines, 30 removed lines. Original line number Diff line number Diff line Loading @@ -81,12 +81,12 @@ <title>Conditional Per-Request Settings</title> <p>For additional flexibility, the directives provided by mod_setenvif allow environment variables to be set on a per-request basis, conditional on characteristics of particular <module>mod_setenvif</module> allow environment variables to be set on a per-request basis, conditional on characteristics of particular requests. For example, a variable could be set only when a specific browser (User-Agent) is making a request, or only when a specific Referer [sic] header is found. Even more flexibility is available through the mod_rewrite's <directive is available through the <module>mod_rewrite</module>'s <directive module="mod_rewrite">RewriteRule</directive> which uses the <code>[E=...]</code> option to set environment variables.</p> Loading @@ -94,8 +94,7 @@ <section id="unique-identifiers"> <title>Unique Identifiers</title> <p>Finally, mod_unique_id sets the environment variable <code>UNIQUE_ID</code> for each request to a value which is <p>Finally, <module>mod_unique_id</module> sets the environment variable <code>UNIQUE_ID</code> for each request to a value which is guaranteed to be unique across "all" requests under very specific conditions.</p> Loading Loading @@ -178,7 +177,7 @@ <section id="ssi-pages"> <title>SSI Pages</title> <p>Server-parsed (SSI) documents processed by mod_include's <p>Server-parsed (SSI) documents processed by <module>mod_include</module>'s <code>INCLUDES</code> filter can print environment variables using the <code>echo</code> element, and can use environment variables in flow control elements to makes parts of a page Loading Loading @@ -244,14 +243,15 @@ <section id="url-rewriting"> <title>URL Rewriting</title> <p>The <code>%{ENV:...}</code> form of <em>TestString</em> in the <directive module="mod_rewrite">RewriteCond</directive> allows mod_rewrite's rewrite <p>The <code>%{ENV:<em>variable</em>}</code> form of <em>TestString</em> in the <directive module="mod_rewrite" >RewriteCond</directive> allows <module>mod_rewrite</module>'s rewrite engine to make decisions conditional on environment variables. Note that the variables accessible in mod_rewrite without the <code>ENV:</code> prefix are not actually environment variables. Rather, they are variables special to mod_rewrite which cannot be accessed from other modules.</p> Note that the variables accessible in <module>mod_rewrite</module> without the <code>ENV:</code> prefix are not actually environment variables. Rather, they are variables special to <module>mod_rewrite</module> which cannot be accessed from other modules.</p> </section> </section> Loading Loading @@ -300,9 +300,10 @@ <section id="gzip-only-text-html"> <title>gzip-only-text/html</title> <p>When set to a value of "1", this variable disables the DEFLATE output filter provided by <module>mod_deflate</module> for content-types other than <code>text/html</code>.</p> <p>When set to a value of "1", this variable disables the <code>DEFLATE</code> output filter provided by <module>mod_deflate</module> for content-types other than <code>text/html</code>.</p> </section> <section id="no-gzip"><title>no-gzip</title> Loading @@ -315,7 +316,8 @@ <section id="nokeepalive"> <title>nokeepalive</title> <p>This disables <directive module="core">KeepAlive</directive> when set.</p> <p>This disables <directive module="core">KeepAlive</directive> when set.</p> </section> Loading Loading @@ -352,10 +354,12 @@ the client can't (or doesn't) automatically follow the redirection. Apache ordinarily labels this text according to the character set which it uses, which is ISO-8859-1.</p> <p> However, if the redirection is to a page that uses a different character set, some broken browser versions will try to use the character set from the redirection text rather than the actual page. This can result in Greek, for instance, being incorrectly rendered.</p> <p>Setting this environment variable causes Apache to omit the character set for the redirection text, and these broken browsers will then correctly use that of the destination page.</p> Loading Loading @@ -401,11 +405,13 @@ BrowserMatch "JDK/1\.0" force-response-1.0</pre></example> access log. It can be easily modified to prevent logging of particular directories, or to prevent logging of requests coming from particular hosts.</p> <example><pre> SetEnvIf Request_URI \.gif image-request SetEnvIf Request_URI \.jpg image-request SetEnvIf Request_URI \.png image-request CustomLog logs/access_log common env=!image-request</pre></example> <example> SetEnvIf Request_URI \.gif image-request<br /> SetEnvIf Request_URI \.jpg image-request<br /> SetEnvIf Request_URI \.png image-request<br /> CustomLog logs/access_log common env=!image-request </example> </section> <section id="image-theft"> Loading @@ -416,20 +422,24 @@ CustomLog logs/access_log common env=!image-request</pre></example> pages. This is not a recommended configuration, but it can work in limited circumstances. We assume that all your images are in a directory called /web/images.</p> <example><pre> SetEnvIf Referer "^http://www.example.com/" local_referal <example> SetEnvIf Referer "^http://www\.example\.com/" local_referal # Allow browsers that do not send Referer info SetEnvIf Referer "^$" local_referal <Directory /web/images> Order Deny,Allow Deny from all <indent> Order Deny,Allow<br /> Deny from all<br /> Allow from env=local_referal </Directory></pre></example> </indent> </Directory> </example> <p>For more information about this technique, see the ApacheToday tutorial " <a href="http://apachetoday.com/news_story.php3?ltsn=2000-06-14-002-01-PS"> Keeping Your Images from Adorning Other Sites</a>".</p> "<a href="http://www.serverwatch.com/tutorials/article.php/1132731" >Keeping Your Images from Adorning Other Sites</a>" tutorial on ServerWatch.</p> </section> </section> </manualpage> Loading
docs/manual/env.xml +40 −30 Changes for docs/manual/env.xml: 40 added lines, 30 removed lines. Original line number Diff line number Diff line Loading @@ -81,12 +81,12 @@ <title>Conditional Per-Request Settings</title> <p>For additional flexibility, the directives provided by mod_setenvif allow environment variables to be set on a per-request basis, conditional on characteristics of particular <module>mod_setenvif</module> allow environment variables to be set on a per-request basis, conditional on characteristics of particular requests. For example, a variable could be set only when a specific browser (User-Agent) is making a request, or only when a specific Referer [sic] header is found. Even more flexibility is available through the mod_rewrite's <directive is available through the <module>mod_rewrite</module>'s <directive module="mod_rewrite">RewriteRule</directive> which uses the <code>[E=...]</code> option to set environment variables.</p> Loading @@ -94,8 +94,7 @@ <section id="unique-identifiers"> <title>Unique Identifiers</title> <p>Finally, mod_unique_id sets the environment variable <code>UNIQUE_ID</code> for each request to a value which is <p>Finally, <module>mod_unique_id</module> sets the environment variable <code>UNIQUE_ID</code> for each request to a value which is guaranteed to be unique across "all" requests under very specific conditions.</p> Loading Loading @@ -178,7 +177,7 @@ <section id="ssi-pages"> <title>SSI Pages</title> <p>Server-parsed (SSI) documents processed by mod_include's <p>Server-parsed (SSI) documents processed by <module>mod_include</module>'s <code>INCLUDES</code> filter can print environment variables using the <code>echo</code> element, and can use environment variables in flow control elements to makes parts of a page Loading Loading @@ -244,14 +243,15 @@ <section id="url-rewriting"> <title>URL Rewriting</title> <p>The <code>%{ENV:...}</code> form of <em>TestString</em> in the <directive module="mod_rewrite">RewriteCond</directive> allows mod_rewrite's rewrite <p>The <code>%{ENV:<em>variable</em>}</code> form of <em>TestString</em> in the <directive module="mod_rewrite" >RewriteCond</directive> allows <module>mod_rewrite</module>'s rewrite engine to make decisions conditional on environment variables. Note that the variables accessible in mod_rewrite without the <code>ENV:</code> prefix are not actually environment variables. Rather, they are variables special to mod_rewrite which cannot be accessed from other modules.</p> Note that the variables accessible in <module>mod_rewrite</module> without the <code>ENV:</code> prefix are not actually environment variables. Rather, they are variables special to <module>mod_rewrite</module> which cannot be accessed from other modules.</p> </section> </section> Loading Loading @@ -300,9 +300,10 @@ <section id="gzip-only-text-html"> <title>gzip-only-text/html</title> <p>When set to a value of "1", this variable disables the DEFLATE output filter provided by <module>mod_deflate</module> for content-types other than <code>text/html</code>.</p> <p>When set to a value of "1", this variable disables the <code>DEFLATE</code> output filter provided by <module>mod_deflate</module> for content-types other than <code>text/html</code>.</p> </section> <section id="no-gzip"><title>no-gzip</title> Loading @@ -315,7 +316,8 @@ <section id="nokeepalive"> <title>nokeepalive</title> <p>This disables <directive module="core">KeepAlive</directive> when set.</p> <p>This disables <directive module="core">KeepAlive</directive> when set.</p> </section> Loading Loading @@ -352,10 +354,12 @@ the client can't (or doesn't) automatically follow the redirection. Apache ordinarily labels this text according to the character set which it uses, which is ISO-8859-1.</p> <p> However, if the redirection is to a page that uses a different character set, some broken browser versions will try to use the character set from the redirection text rather than the actual page. This can result in Greek, for instance, being incorrectly rendered.</p> <p>Setting this environment variable causes Apache to omit the character set for the redirection text, and these broken browsers will then correctly use that of the destination page.</p> Loading Loading @@ -401,11 +405,13 @@ BrowserMatch "JDK/1\.0" force-response-1.0</pre></example> access log. It can be easily modified to prevent logging of particular directories, or to prevent logging of requests coming from particular hosts.</p> <example><pre> SetEnvIf Request_URI \.gif image-request SetEnvIf Request_URI \.jpg image-request SetEnvIf Request_URI \.png image-request CustomLog logs/access_log common env=!image-request</pre></example> <example> SetEnvIf Request_URI \.gif image-request<br /> SetEnvIf Request_URI \.jpg image-request<br /> SetEnvIf Request_URI \.png image-request<br /> CustomLog logs/access_log common env=!image-request </example> </section> <section id="image-theft"> Loading @@ -416,20 +422,24 @@ CustomLog logs/access_log common env=!image-request</pre></example> pages. This is not a recommended configuration, but it can work in limited circumstances. We assume that all your images are in a directory called /web/images.</p> <example><pre> SetEnvIf Referer "^http://www.example.com/" local_referal <example> SetEnvIf Referer "^http://www\.example\.com/" local_referal # Allow browsers that do not send Referer info SetEnvIf Referer "^$" local_referal <Directory /web/images> Order Deny,Allow Deny from all <indent> Order Deny,Allow<br /> Deny from all<br /> Allow from env=local_referal </Directory></pre></example> </indent> </Directory> </example> <p>For more information about this technique, see the ApacheToday tutorial " <a href="http://apachetoday.com/news_story.php3?ltsn=2000-06-14-002-01-PS"> Keeping Your Images from Adorning Other Sites</a>".</p> "<a href="http://www.serverwatch.com/tutorials/article.php/1132731" >Keeping Your Images from Adorning Other Sites</a>" tutorial on ServerWatch.</p> </section> </section> </manualpage>