From 9eacb1b3f693715e6e6d06c6079a8cf38119b54d Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Tue, 15 Feb 2011 12:15:49 +0000 Subject: [PATCH] Rebuild documents from xml, including new access control howto. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070862 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/howto/access.html | 5 + docs/manual/howto/access.html.en | 170 +++++++++++++++++++++++++++ docs/manual/howto/access.xml.meta | 12 ++ docs/manual/howto/index.html.ja.utf8 | 2 + docs/manual/howto/index.xml.ja | 2 +- docs/manual/howto/index.xml.ko | 2 +- docs/manual/howto/index.xml.meta | 2 +- 7 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 docs/manual/howto/access.html create mode 100644 docs/manual/howto/access.html.en create mode 100644 docs/manual/howto/access.xml.meta diff --git a/docs/manual/howto/access.html b/docs/manual/howto/access.html new file mode 100644 index 0000000000..dad5faec44 --- /dev/null +++ b/docs/manual/howto/access.html @@ -0,0 +1,5 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: access.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/howto/access.html.en b/docs/manual/howto/access.html.en new file mode 100644 index 0000000000..71154f4288 --- /dev/null +++ b/docs/manual/howto/access.html.en @@ -0,0 +1,170 @@ + + + +Access Control - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.3 > How-To / Tutorials

Access Control

+
+

Available Languages:  en 

+
+ +

Access control refers to any means of controlling access to any + resource. This is separate from authentication and authorization.

+
+ +
top
+
+

Related Modules and Directives

+ +

Access control can be done by several different modules. The most +important of these are mod_authz_core and +mod_authz_host. Other modules +discussed in this document include mod_rewrite.

+ +
top
+
+

Access control by host

+

+ If you wish to restrict access to portions of your site based on the + host address of your visitors, this is most easily done using + mod_authz_host. +

+ +

The Allow and + Deny directives let + you allow and deny access based on the host name, or host + address, of the machine requesting a document. The + Order directive goes + hand-in-hand with these two, and tells Apache in which order to + apply the filters.

+ +

The usage of these directives is:

+ +

+ Require host address
+ Require ip ip.address +

+ +

In the first form, address is a fully qualified + domain name (or a partial domain name); you may provide multiple + addresses or domain names, if desired.

+ +

In the second form, ip.address is an IP address, a + partial IP address, a network/netmask pair, or a network/nnn CIDR + specification. Either IPv4 or IPv6 addresses may be used.

+ +

For example, if you have someone spamming your message + board, and you want to keep them out, you could do the + following:

+ +

+ Require not ip 10.252.46.165 +

+ +

Visitors coming from that address will not be able to see + the content covered by this directive. If, instead, you have a + machine name, rather than an IP address, you can use that.

+ +

+ Require not host host.example.com +

+ +

And, if you'd like to block access from an entire domain, + you can specify just part of an address or domain name:

+ +

+ Require not ip 192.168.205
+ Require not host phishers.example.com moreidiots.example
+ Require not gov +

+ +

Use of the RequireAll, RequireAny, and RequireNone directives may be + used to enforce more complex sets of requirements.

+ +
top
+
+

Access control by environment variable

+ +

Using the <If>, + you can allow or deny access based on arbitrary environment + variables or request header values. For example, to deny access + based on user-agent (the browser type) you might do the + following:

+ +

+ <If "%{HTTP_USER_AGENT} = 'BadBot'">
+ + Require All Denied
+
+ </If> +

+ +

Warning:

+

Access control by User-Agent is an unreliable technique, + since the User-Agent header can be set to anything at all, + at the whim of the end user.

+
+ +

See the expressions document for a + further discussion of what expression syntaxes and variables are + available to you.

+ +
top
+
+

Access control with mod_rewrite

+ +

The [F] RewriteRule flag causes a 403 Forbidden +response to be sent. Using this, you can deny access to a resource based +on arbitrary criteria.

+ +

For example, if you wish to block access to a resource between 8pm +and 6am, you can do this using mod_rewrite.

+ +

+RewriteEngine On
+RewriteCond %{TIME_HOUR} >20 [OR]
+RewriteCond %{TIME_HOUR} <07
+RewriteRule ^/fridge - [F] +

+ +

This will return a 403 Forbidden response for any request after 8pm +or before 7am. This technique can be used for any criteria that you wish +to check. You can also redirect, or otherwise rewrite these requests, if +that approach is preferred.

+ +
top
+
+

More information

+

You should also read the documentation for + mod_auth_basic and mod_authz_host which + contain some more information about how this all works. + mod_authn_alias can also help in simplifying certain + authentication configurations.

+ +

See the Authentication and Authorization + howto.

+
+
+

Available Languages:  en 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/access.xml.meta b/docs/manual/howto/access.xml.meta new file mode 100644 index 0000000000..14174dccd5 --- /dev/null +++ b/docs/manual/howto/access.xml.meta @@ -0,0 +1,12 @@ + + + + + access + /howto/ + .. + + + en + + diff --git a/docs/manual/howto/index.html.ja.utf8 b/docs/manual/howto/index.html.ja.utf8 index 1759991024..c476ef1aed 100644 --- a/docs/manual/howto/index.html.ja.utf8 +++ b/docs/manual/howto/index.html.ja.utf8 @@ -23,6 +23,8 @@  ja  |  ko 

+
この日本語訳はすでに古くなっている可能性があります。 + 更新された内容を見るには英語版をご覧下さい。
top
diff --git a/docs/manual/howto/index.xml.ja b/docs/manual/howto/index.xml.ja index 34220d9dab..84df69899d 100644 --- a/docs/manual/howto/index.xml.ja +++ b/docs/manual/howto/index.xml.ja @@ -1,7 +1,7 @@ - + +