From e8c29d9273f9edac2f124e9100c6d661df88adfb Mon Sep 17 00:00:00 2001
From: Daniel Gruno The usage of these directives is: In the first form, address is a fully qualified
domain name (or a partial domain name); you may provide multiple
@@ -105,11 +106,12 @@
And, if you'd like to block access from an entire domain,
you can specify just part of an address or domain name: Use of the
- Require host address
+
+ Require host address
Require ip ip.address
-
- Require not ip 192.168.205
- Require not host phishers.example.com moreidiots.example
+
+ Require not ip 192.168.205
+ Require not host phishers.example.com moreidiots.example
Require not gov
-
RequireAll
, RequireAny
, and RequireNone
directives may be
used to enforce more complex sets of requirements.
- <If "%{HTTP_USER_AGENT} = 'BadBot'">
-
- Require All Denied
-
+
+ <If "%{HTTP_USER_AGENT} = 'BadBot'">
+ Require All Denied
</If>
-
Access control by User-Agent
is an unreliable technique,
@@ -153,12 +154,13 @@
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
+
+ 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 diff --git a/docs/manual/howto/access.xml b/docs/manual/howto/access.xml index fe386be2aa..62ffd60075 100644 --- a/docs/manual/howto/access.xml +++ b/docs/manual/howto/access.xml @@ -67,10 +67,10 @@
The usage of these directives is:
-In the first form, address is a fully qualified domain name (or a partial domain name); you may provide multiple @@ -104,11 +104,11 @@
And, if you'd like to block access from an entire domain, you can specify just part of an address or domain name:
-Use of the Access control by For example, if you wish to block access to a resource between 8pm
and 6am, you can do this using 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
diff --git a/docs/manual/howto/auth.html.en b/docs/manual/howto/auth.html.en
index c069f5c898..21aa5daea4 100644
--- a/docs/manual/howto/auth.html.en
+++ b/docs/manual/howto/auth.html.en
@@ -142,9 +142,10 @@ module from each group.
-
- User-Agent
is an unreliable technique,
@@ -156,12 +154,12 @@
- RewriteCond %{TIME_HOUR} >20 [OR]
- RewriteCond %{TIME_HOUR} <07
+ AllowOverride
directive like the
following:
+
AllowOverride AuthConfig
-
Or, if you are just going to put the directives directly in your main server configuration file, you will of course need to @@ -216,14 +217,15 @@ module from each group.
placed inhttpd.conf
inside a <Directory
/usr/local/apache/htdocs/secret> section.
-
- AuthType Basic
- AuthName "Restricted Files"
- # (Following line optional)
- AuthBasicProvider file
- AuthUserFile /usr/local/apache/passwd/passwords
+
+ AuthType Basic
+ AuthName "Restricted Files"
+ # (Following line optional)
+ AuthBasicProvider file
+ AuthUserFile /usr/local/apache/passwd/passwords
Require user rbowen
-
Let's examine each of those directives individually. The AuthType
directive selects
that method that is used to authenticate the user. The most
@@ -313,15 +315,16 @@ person in
Now, you need to modify your .htaccess
file to
look like the following:
- AuthType Basic
- AuthName "By Invitation Only"
- # Optional line:
- AuthBasicProvider file
- AuthUserFile /usr/local/apache/passwd/passwords
- AuthGroupFile /usr/local/apache/passwd/groups
+
+ AuthType Basic
+ AuthName "By Invitation Only"
+ # Optional line:
+ AuthBasicProvider file
+ AuthUserFile /usr/local/apache/passwd/passwords
+ AuthGroupFile /usr/local/apache/passwd/groups
Require group GroupName
-
Now, anyone that is listed in the group GroupName
,
and has an entry in the password
file, will be let in, if
@@ -379,17 +382,16 @@ person in
To select a dbd file rather than a text file, for example:
-
- <Directory /www/docs/private>
-
- AuthName "Private"
- AuthType Basic
- AuthBasicProvider dbm
- AuthDBMUserFile /www/passwords/passwd.dbm
- Require valid-user
-
+
+ <Directory /www/docs/private>
+ AuthName "Private"
+ AuthType Basic
+ AuthBasicProvider dbm
+ AuthDBMUserFile /www/passwords/passwd.dbm
+ Require valid-user
</Directory>
-
Other options are available. Consult the
mod_authn_dbm
documentation for more details.
- <Directory /www/docs/private>
-
- AuthName "Private"
- AuthType Basic
- AuthBasicProvider file ldap
- AuthUserFile /usr/local/apache/passwd/passwords
- AuthLDAPURL ldap://ldaphost/o=yourorg
- Require valid-user
-
+
+ <Directory /www/docs/private>
+ AuthName "Private"
+ AuthType Basic
+ AuthBasicProvider file ldap
+ AuthUserFile /usr/local/apache/passwd/passwords
+ AuthLDAPURL ldap://ldaphost/o=yourorg
+ Require valid-user
</Directory>
-
In this example the file provider will attempt to authenticate the user first. If it is unable to authenticate the user, the LDAP @@ -430,20 +431,19 @@ person in authorization methods can also be used. In this example both file group authorization as well as LDAP group authorization is being used.
-
- <Directory /www/docs/private>
-
- AuthName "Private"
- AuthType Basic
- AuthBasicProvider file
- AuthUserFile /usr/local/apache/passwd/passwords
- AuthLDAPURL ldap://ldaphost/o=yourorg
- AuthGroupFile /usr/local/apache/passwd/groups
- Require group GroupName
- Require ldap-group cn=mygroup,o=yourorg
-
+
+ <Directory /www/docs/private>
+ AuthName "Private"
+ AuthType Basic
+ AuthBasicProvider file
+ AuthUserFile /usr/local/apache/passwd/passwords
+ AuthLDAPURL ldap://ldaphost/o=yourorg
+ AuthGroupFile /usr/local/apache/passwd/groups
+ Require group GroupName
+ Require ldap-group cn=mygroup,o=yourorg
</Directory>
-
To take authorization a little further, authorization container directives such as @@ -521,16 +521,18 @@ person in that will be called during the authorization stage of the request processing. For example:
-
+
Require ip address
-
where address is an IP address (or a partial IP address) or:
-
+
Require host domain_name
-
where domain_name is a fully qualified domain name (or a partial domain name); you may provide multiple addresses or @@ -540,45 +542,40 @@ person in board, and you want to keep them out, you could do the following:
-
+
<RequireAll>
-
- Require all granted
+ Require all granted
Require not ip 10.252.46.165
-
</RequireAll>
-
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.
-
+
<RequireAll>
-
- Require all granted
+ Require all granted
Require not host host.example.com
-
</RequireAll>
-
And, if you'd like to block access from an entire domain, you can specify just part of an address or domain name:
-
- <RequireAll>
-
- Require all granted
- <RequireNone>
-
- Require ip 192.168.205
- Require host phishers.example.com moreidiots.example
- Require host ke
-
- </RequireNone>
-
- </RequireAll>
-
+ <RequireAll> + Require all granted + <RequireNone> + Require ip 192.168.205 + Require host phishers.example.com moreidiots.example + Require host ke + </RequireNone> + </RequireAll> ++
The above example uses the <RequireNone>
directive
to make sure that none of the
diff --git a/docs/manual/howto/auth.xml b/docs/manual/howto/auth.xml
index 1c8c019e53..01e139818c 100644
--- a/docs/manual/howto/auth.xml
+++ b/docs/manual/howto/auth.xml
@@ -127,9 +127,9 @@ module from each group.
Or, if you are just going to put the directives directly in your main server configuration file, you will of course need to @@ -201,14 +201,14 @@ module from each group.
placed inhttpd.conf
inside a <Directory
/usr/local/apache/htdocs/secret> section.
- Let's examine each of those directives individually. The
Now, you need to modify your .htaccess
file to
look like the following:
Now, anyone that is listed in the group GroupName
,
and has an entry in the password
file, will be let in, if
@@ -372,17 +372,15 @@ person in
To select a dbd file rather than a text file, for example:
-Other options are available. Consult the
In this example the file provider will attempt to authenticate the user first. If it is unable to authenticate the user, the LDAP @@ -423,20 +419,18 @@ person in authorization methods can also be used. In this example both file group authorization as well as LDAP group authorization is being used.
-To take authorization a little further, authorization container directives such as @@ -514,16 +508,16 @@ person in that will be called during the authorization stage of the request processing. For example:
-where address is an IP address (or a partial IP address) or:
-where domain_name is a fully qualified domain name (or a partial domain name); you may provide multiple addresses or @@ -533,45 +527,37 @@ person in board, and you want to keep them out, you could do the following:
-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.
-And, if you'd like to block access from an entire domain, you can specify just part of an address or domain name:
-The above example uses the
.htaccess
you can use:
-
-<Directory /www/htdocs>
-
-Allowoverride All
-
-</Directory>
-
-<Location />
-
-Options +IncludesNoExec -ExecCGI
-
+
+<Directory /www/htdocs>
+ Allowoverride All
+</Directory>
+
+<Location />
+ Options +IncludesNoExec -ExecCGI
</Location>
-
DocumentRoot
is /www/htdocs
..htaccess
file contents:
- AuthType Basic
- AuthName "Password Required"
- AuthUserFile /www/passwords/password.file
- AuthGroupFile /www/passwords/group.file
+
+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
Require Group admins
-
Note that AllowOverride AuthConfig
must be in effect
for these directives to have any effect.
.htaccess
file in the desired directory:
-
- Options +Includes
- AddType text/html shtml
+
+ Options +Includes
+ AddType text/html shtml
AddHandler server-parsed shtml
-
Note that AllowOverride Options
and AllowOverride
FileInfo
must both be in effect for these directives to have any
@@ -352,19 +351,21 @@ Options +IncludesNoExec -ExecCGI
the execution of CGI programs in a particular directory. This may be
implemented with the following configuration:
+
Options +ExecCGI
AddHandler cgi-script cgi pl
-
Alternately, if you wish to have all files in the given directory be considered to be CGI programs, this may be done with the following configuration:
-
+
Options +ExecCGI
SetHandler cgi-script
-
Note that AllowOverride Options
and AllowOverride
FileInfo
must both be in effect for these directives to have any
diff --git a/docs/manual/howto/htaccess.xml b/docs/manual/howto/htaccess.xml
index a50a3b2c71..debdc1d55c 100644
--- a/docs/manual/howto/htaccess.xml
+++ b/docs/manual/howto/htaccess.xml
@@ -299,19 +299,15 @@ changes on a per-directory basis.
.htaccess
you can use:
- /www/htdocs
..htaccess
file contents:
Note that AllowOverride AuthConfig
must be in effect
for these directives to have any effect.
.htaccess
file in the desired directory:
- Note that AllowOverride Options
and AllowOverride
FileInfo
must both be in effect for these directives to have any
@@ -381,19 +377,19 @@ Options +IncludesNoExec -ExecCGI
the execution of CGI programs in a particular directory. This may be
implemented with the following configuration:
Alternately, if you wish to have all files in the given directory be considered to be CGI programs, this may be done with the following configuration:
-Note that AllowOverride Options
and AllowOverride
FileInfo
must both be in effect for these directives to have any
diff --git a/docs/manual/howto/public_html.html.en b/docs/manual/howto/public_html.html.en
index 7e8d168678..7b9c2b3742 100644
--- a/docs/manual/howto/public_html.html.en
+++ b/docs/manual/howto/public_html.html.en
@@ -80,9 +80,10 @@
constructed using that path, plus the username specified. Given this
configuration:
+
UserDir /var/html
-
the URL http://example.com/~rbowen/file.html
will be
translated to the file path /var/html/rbowen/file.html
+
UserDir /var/www/*/docs
-
the URL http://example.com/~rbowen/file.html
will be
translated to the file path
@@ -118,9 +120,10 @@
The UserDir
directive can be
used to redirect user directory requests to external URLs.
+
UserDir http://example.org/users/*/
-
The above example will redirect a request for
http://example.com/~bob/abc.html
to
@@ -134,19 +137,21 @@
Using the syntax shown in the UserDir documentation, you can restrict what users are permitted to use this functionality:
-
+
UserDir disabled root jro fish
-
The configuration above will enable the feature for all users
except for those listed in the disabled
statement.
You can, likewise, disable the feature for all but a few users by
using a configuration like the following:
+
UserDir disabled
UserDir enabled rbowen krietz
-
See UserDir
documentation for additional examples.
- <Directory /home/*/public_html/cgi-bin/>
- Options ExecCGI
- SetHandler cgi-script
+
+ <Directory /home/*/public_html/cgi-bin/>
+ Options ExecCGI
+ SetHandler cgi-script
</Directory>
-
Then, presuming that UserDir
is set to
public_html
, a cgi program example.cgi
diff --git a/docs/manual/howto/public_html.xml b/docs/manual/howto/public_html.xml
index d2da191548..d72c19fc69 100644
--- a/docs/manual/howto/public_html.xml
+++ b/docs/manual/howto/public_html.xml
@@ -84,9 +84,9 @@
constructed using that path, plus the username specified. Given this
configuration:
the URL http://example.com/~rbowen/file.html
will be
translated to the file path /var/html/rbowen/file.html
the URL http://example.com/~rbowen/file.html
will be
translated to the file path
@@ -122,9 +122,9 @@
The
The above example will redirect a request for
http://example.com/~bob/abc.html
to
@@ -138,19 +138,19 @@
Using the syntax shown in the UserDir documentation, you can restrict what users are permitted to use this functionality:
-The configuration above will enable the feature for all users
except for those listed in the disabled
statement.
You can, likewise, disable the feature for all but a few users by
using a configuration like the following:
See
Then, presuming that UserDir
is set to
public_html
, a cgi program example.cgi
diff --git a/docs/manual/howto/ssi.html.en b/docs/manual/howto/ssi.html.en
index 99e61ea716..dac9c1ab01 100644
--- a/docs/manual/howto/ssi.html.en
+++ b/docs/manual/howto/ssi.html.en
@@ -96,10 +96,11 @@ existing HTML documents.
.shtml
, with
the following directives:
-
+
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
-
One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to @@ -108,9 +109,10 @@ existing HTML documents.
directives would be executed.The other method is to use the XBitHack
directive:
+
XBitHack on
-
XBitHack
tells Apache to parse files for SSI
@@ -431,10 +433,11 @@ modified?
In your configuration file, you could put the following line:
-
+
BrowserMatchNoCase macintosh Mac
BrowserMatchNoCase MSIE InternetExplorer
-
This will set environment variables ``Mac'' and ``InternetExplorer'' to true, if the client is running Internet diff --git a/docs/manual/howto/ssi.xml b/docs/manual/howto/ssi.xml index c9ef923462..017b3a473f 100644 --- a/docs/manual/howto/ssi.xml +++ b/docs/manual/howto/ssi.xml @@ -98,10 +98,10 @@ existing HTML documents.
do this. You can tell Apache to parse any file with a particular file extension, such as.shtml
, with
the following directives:
-One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to @@ -111,9 +111,9 @@ existing HTML documents.
The other method is to use the
In your configuration file, you could put the following line:
-This will set environment variables ``Mac'' and ``InternetExplorer'' to true, if the client is running Internet -- 2.50.0