diff options
author | Rich Bowen <rbowen@apache.org> | 2009-11-05 01:43:08 +0100 |
---|---|---|
committer | Rich Bowen <rbowen@apache.org> | 2009-11-05 01:43:08 +0100 |
commit | b7a270f9b4cc7b72b2d32f272c4752701b9cb683 (patch) | |
tree | d72abc53e5df49ff2cb3d46b3fe808ecabd5dfa1 /docs/manual | |
parent | Relocates another recipe, and updates it. (diff) | |
download | apache2-b7a270f9b4cc7b72b2d32f272c4752701b9cb683.tar.xz apache2-b7a270f9b4cc7b72b2d32f272c4752701b9cb683.zip |
Relocates another rule.
Please also note that this rule refers to before and after 1.3b6.
That's embarrassing. It would be great if someone would apply the
relevant changes to the 2.2 and 2.0 docs also.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832935 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual')
-rw-r--r-- | docs/manual/rewrite/access.html.en | 55 | ||||
-rw-r--r-- | docs/manual/rewrite/access.xml | 52 | ||||
-rw-r--r-- | docs/manual/rewrite/rewrite_guide.html.en | 56 | ||||
-rw-r--r-- | docs/manual/rewrite/rewrite_guide.xml | 55 |
4 files changed, 106 insertions, 112 deletions
diff --git a/docs/manual/rewrite/access.html.en b/docs/manual/rewrite/access.html.en index 79cdaddb7c..f65183ab77 100644 --- a/docs/manual/rewrite/access.html.en +++ b/docs/manual/rewrite/access.html.en @@ -37,6 +37,7 @@ configuration.</div> </div> <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#blocked-inline-images">Forbidding Image "Hotlinking"</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#blocking-of-robots">Blocking of Robots</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#host-deny">Denying Hosts in a Blacklist</a></li> </ul><h3>See also</h3><ul class="seealso"><li><a href="../mod/mod_rewrite.html">Module documentation</a></li><li><a href="intro.html">mod_rewrite introduction</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> @@ -191,7 +192,59 @@ RewriteRule ^<strong>/secret/files/</strong> - [<strong>F</strong>] </dl> - </div></div> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="host-deny" id="host-deny">Denying Hosts in a Blacklist</a></h2> + + + + <dl> + <dt>Description:</dt> + + <dd> + <p>We wish to maintain a blacklist of hosts, rather like + <code>hosts.deny</code>, and have those hosts blocked from + accessing our server.</p> + </dd> + + <dt>Solution:</dt> + + <dd> +<div class="example"><pre> +RewriteEngine on +RewriteMap hosts-deny txt:/path/to/hosts.deny +RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR] +RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND +RewriteRule ^ - [F] +</pre></div> + +<div class="example"><pre> +## +## hosts.deny +## +## ATTENTION! This is a map, not a list, even when we treat it as such. +## mod_rewrite parses it for key/value pairs, so at least a +## dummy value "-" must be present for each entry. +## + +193.102.180.41 - +bsdti1.sdm.de - +192.76.162.40 - +</pre></div> + </dd> + + <dt>Discussion:</dt> + <dd> + <p> + The second RewriteCond assumes that you have HostNameLookups turned + on, so that client IP addresses will be resolved. If that's not the + case, you should drop the second rule, and drop the + <code>[OR]</code> flag from the first RewriteCond. + </p> + </dd> + </dl> + +</div></div> <div class="bottomlang"> <p><span>Available Languages: </span><a href="../en/rewrite/access.html" title="English"> en </a></p> </div><div id="footer"> diff --git a/docs/manual/rewrite/access.xml b/docs/manual/rewrite/access.xml index 693fe3e182..da6e459786 100644 --- a/docs/manual/rewrite/access.xml +++ b/docs/manual/rewrite/access.xml @@ -196,4 +196,56 @@ RewriteRule ^<strong>/secret/files/</strong> - [<strong>F</strong>] </section> +<section id="host-deny"> + + <title>Denying Hosts in a Blacklist</title> + + <dl> + <dt>Description:</dt> + + <dd> + <p>We wish to maintain a blacklist of hosts, rather like + <code>hosts.deny</code>, and have those hosts blocked from + accessing our server.</p> + </dd> + + <dt>Solution:</dt> + + <dd> +<example><pre> +RewriteEngine on +RewriteMap hosts-deny txt:/path/to/hosts.deny +RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR] +RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND +RewriteRule ^ - [F] +</pre></example> + +<example><pre> +## +## hosts.deny +## +## ATTENTION! This is a map, not a list, even when we treat it as such. +## mod_rewrite parses it for key/value pairs, so at least a +## dummy value "-" must be present for each entry. +## + +193.102.180.41 - +bsdti1.sdm.de - +192.76.162.40 - +</pre></example> + </dd> + + <dt>Discussion:</dt> + <dd> + <p> + The second RewriteCond assumes that you have HostNameLookups turned + on, so that client IP addresses will be resolved. If that's not the + case, you should drop the second rule, and drop the + <code>[OR]</code> flag from the first RewriteCond. + </p> + </dd> + </dl> + +</section> + </manualpage> diff --git a/docs/manual/rewrite/rewrite_guide.html.en b/docs/manual/rewrite/rewrite_guide.html.en index 010c78e26d..b20e8d67ed 100644 --- a/docs/manual/rewrite/rewrite_guide.html.en +++ b/docs/manual/rewrite/rewrite_guide.html.en @@ -61,7 +61,6 @@ <li><img alt="" src="../images/down.gif" /> <a href="#on-the-fly-content">On-the-fly Content-Regeneration</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#autorefresh">Document With Autorefresh</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#mass-virtual-hosting">Mass Virtual Hosting</a></li> -<li><img alt="" src="../images/down.gif" /> <a href="#host-deny">Host Deny</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#proxy-deny">Proxy Deny</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#special-authentication">Special Authentication Variant</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#referer-deflector">Referer-based Deflector</a></li> @@ -1210,61 +1209,6 @@ RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}] </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> -<h2><a name="host-deny" id="host-deny">Host Deny</a></h2> - - - - <dl> - <dt>Description:</dt> - - <dd> - <p>How can we forbid a list of externally configured hosts - from using our server?</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>For Apache >= 1.3b6:</p> - -<div class="example"><pre> -RewriteEngine on -RewriteMap hosts-deny txt:/path/to/hosts.deny -RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR] -RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND -RewriteRule ^/.* - [F] -</pre></div> - - <p>For Apache <= 1.3b6:</p> - -<div class="example"><pre> -RewriteEngine on -RewriteMap hosts-deny txt:/path/to/hosts.deny -RewriteRule ^/(.*)$ ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}/$1 -RewriteRule !^NOT-FOUND/.* - [F] -RewriteRule ^NOT-FOUND/(.*)$ ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}/$1 -RewriteRule !^NOT-FOUND/.* - [F] -RewriteRule ^NOT-FOUND/(.*)$ /$1 -</pre></div> - -<div class="example"><pre> -## -## hosts.deny -## -## ATTENTION! This is a map, not a list, even when we treat it as such. -## mod_rewrite parses it for key/value pairs, so at least a -## dummy value "-" must be present for each entry. -## - -193.102.180.41 - -bsdti1.sdm.de - -192.76.162.40 - -</pre></div> - </dd> - </dl> - - </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> -<div class="section"> <h2><a name="proxy-deny" id="proxy-deny">Proxy Deny</a></h2> diff --git a/docs/manual/rewrite/rewrite_guide.xml b/docs/manual/rewrite/rewrite_guide.xml index 106ca72c32..eba14b6bd0 100644 --- a/docs/manual/rewrite/rewrite_guide.xml +++ b/docs/manual/rewrite/rewrite_guide.xml @@ -1201,61 +1201,6 @@ RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}] </section> - <section id="host-deny"> - - <title>Host Deny</title> - - <dl> - <dt>Description:</dt> - - <dd> - <p>How can we forbid a list of externally configured hosts - from using our server?</p> - </dd> - - <dt>Solution:</dt> - - <dd> - <p>For Apache >= 1.3b6:</p> - -<example><pre> -RewriteEngine on -RewriteMap hosts-deny txt:/path/to/hosts.deny -RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR] -RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND -RewriteRule ^/.* - [F] -</pre></example> - - <p>For Apache <= 1.3b6:</p> - -<example><pre> -RewriteEngine on -RewriteMap hosts-deny txt:/path/to/hosts.deny -RewriteRule ^/(.*)$ ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}/$1 -RewriteRule !^NOT-FOUND/.* - [F] -RewriteRule ^NOT-FOUND/(.*)$ ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}/$1 -RewriteRule !^NOT-FOUND/.* - [F] -RewriteRule ^NOT-FOUND/(.*)$ /$1 -</pre></example> - -<example><pre> -## -## hosts.deny -## -## ATTENTION! This is a map, not a list, even when we treat it as such. -## mod_rewrite parses it for key/value pairs, so at least a -## dummy value "-" must be present for each entry. -## - -193.102.180.41 - -bsdti1.sdm.de - -192.76.162.40 - -</pre></example> - </dd> - </dl> - - </section> - <section id="proxy-deny"> <title>Proxy Deny</title> |