From 6e99588f568eed2571842778818a4936d81d9ff2 Mon Sep 17 00:00:00 2001
From: Andre Malo This module allows the use of HTTP Basic Authentication to
restrict access by looking up users in the given providers.
HTTP Digest Authentication is provided by
The On
will choose the default provider
+ (file
). Since the file
provider is implemented
+ by the
See
See
The value Off
clears the provider list and sets it back
+ to the default.
Setting the Off
allows for both
authentication and authorization to be passed on to lower level
- modules (as defined in the Configuration
and
- modules.c
files) if there is no
- userID or rule matching the supplied
- userID. If there is a userID and/or rule specified; the usual
+ modules (as defined in the modules.c
files) if there is
+ no userID or rule matching the
+ supplied userID. If there is a userID and/or rule specified, the usual
password and access checks will be applied and a failure will give
an Authorization Required reply.
By default; control is not passed on; and an unknown userID or +
By default control is not passed on and an unknown userID or rule will result in an Authorization Required reply. Not setting - it thus keeps the system secure; and forces an NCSA compliant + it thus keeps the system secure and forces an NCSA compliant behaviour.
-This module implements HTTP Digest Authentication. However, it +
This module implements HTTP Digest Authentication. However, it has not been extensively tested and is therefore marked experimental.
Using MD5 Digest authentication is very simple. Simply set - up authentication normally, using "AuthType Digest" and - "AuthDigestFile" instead of the normal "AuthType Basic" and - "AuthUserFile"; also, replace any "AuthGroupFile" with - "AuthDigestGroupFile". Then add a "AuthDigestDomain" directive - containing at least the root URI(s) for this protection space. - Example:
- -AuthType Digest
and
+ AuthType Basic
and
+ Appropriate user (text) files can be created using the + htdigest tool.
+ +Digest authentication provides a more secure password system than Basic authentication, but only works with supporting - browsers. As of July 2002, the major browsers that support digest + browsers. As of November 2002, the major browsers that support digest authentication are Opera, MS Internet Explorer (fails when used with a query string), Amaya and Mozilla. Since digest + href="http://www.w3.org/Amaya/">Amaya, Mozilla and Netscape since version 7. Since digest authentication is not as widely implemented as basic - authentication, you should use it only in controlled settings.
+ authentication, you should use it only in controlled environments.The
The digest file uses a special format. Files in this format - can be created using the htdigest utility found in - the support/ subdirectory of the Apache distribution.
-The
Each line of the group file contains a groupname followed by - a colon, followed by the member usernames separated by spaces. - Example:
- -Note that searching large text files is very - inefficient.
- -Security: make sure that the AuthGroupFile is stored outside - the document tree of the web-server; do not put it in - the directory that it protects. Otherwise, clients will be able - to download the AuthGroupFile.
+The On
will choose the default provider
+ (file
). Since the file
provider is implemented
+ by the
See
The value Off
clears the provider list and sets it back
+ to the default.
The auth
will only do
- authentication (username/password); auth-int
is
+ the quality-of-protection to use. auth
will
+ only do authentication (username/password); auth-int
is
authentication plus integrity checking (an MD5 hash of the entity
is also computed and checked); none
will cause the module
to use the old RFC-2069 digest algorithm (which does not include
@@ -155,7 +134,7 @@ authentication
greater than 0 then it specifies the amount of time for which the
nonce is valid; this should probably never be set to less than 10
seconds. If seconds is less than 0 then the nonce never
- expires.
-
MD5-sess
is not correctly implemented yet.
@@ -274,4 +252,36 @@ authentication
+The 0
and read the error message after trying to start the
+ server.
The size is normally expressed in Bytes, but you
+ may let the number follow a K
or an M
to
+ express your value as KBytes or MBytes. For example, the following
+ directives are all equivalent:
This module does access control in a manner similar to - anonymous-ftp sites; i.e. have a 'magic' user id +
This module provides authentication front-ends such as
+
When using anon
value.
The example below (when combined with the Auth directives of a - htpasswd-file based (or GDM, mSQL etc.) base access - control system allows users in as 'guests' with the following - properties:
+The example below is combined with "normal" htpasswd-file based + authentication and allows users in additionally as 'guests' with the + following properties:
Anonymous_NoUserId
)Anonymous_MustGiveEmail
)Anonymous_VerifyEmail
)anonymous guest www test
welcome
and comparison is not case
@@ -50,41 +56,38 @@
Anonymous_LogEmail
)Excerpt of httpd.conf:
- -Please note that the comparison is
case-IN-sensitive.
- I strongly suggest that the magic username
+ It's strongly recommended that the magic username
'anonymous
' is always one of the allowed
userIDs.
Example:
-This would allow the user to enter without password - verification by using the userId's 'anonymous', - 'AnonyMous','Not Registered' and 'I Don't Know'.
- -When set 'on', there is no fall-through to other authorization
- methods. So if a userID does not match the values specified in the
-
Be sure you know what you are doing when you decide to - switch it on. And remember that it is the linking order of the - modules (in the Configuration / Make file) which details the - order in which the Authorization modules are queried.
+ verification by using the userIDs "anonymous", + "AnonyMous", "Not Registered" and "I Don't Know".When set on
, the default, the 'password' entered
+
When set On
, the default, the 'password' entered
(which hopefully contains a sensible email address) is logged in
the error log.
When set on
, users can leave the userID (and
+
When set On
, users can leave the userID (and
perhaps the password field) empty. This can be very convenient for
MS-Explorer users who can just hit return or click directly on the
OK button; which seems a natural reaction.
When set on
the 'password' entered is checked for
+
When set On
the 'password' entered is checked for
at least one '@' and a '.' to encourage users to enter valid email
addresses (see the above
This module provides authentication front-ends such as
When using
dbm
value.
The
The user file is keyed on the username. The value for a user is
@@ -61,8 +60,8 @@ passwords for authentication
download the
Important compatibility note: The implementation of
- "dbmopen" in the apache modules reads the string length of the
- hashed values from the DBM data structures, rather than relying
+ Sets the type of database file that is used to store the passwords.
+ The default database type is determined at compile time. The
+ availability of other types of database files also depends on
+ compile-time settings. Sets the type of database file that is used to store the passwords.
-The default database type is determined at compile time. The
-availability of other types of database files also depends on
-compile-time settings. It is crucial that whatever program you use to create your password
-files is configured to use the same type of database. It is crucial that whatever program you use to create your password
+ files is configured to use the same type of database.dbmopen
in the apache modules reads the string length of
+ the hashed values from the DBM data structures, rather than relying
upon the string being NULL-appended. Some applications, such as
the Netscape web server, rely upon the string being
NULL-appended, so if you are having trouble using DBM files
@@ -82,22 +81,18 @@ passwords for authentication
store passwords
This module is designed to be the fallback module, if you don't
+ have configured an authentication module like
+
Setting the Off
allows for authentication to be passed on
+ to lower level modules (as defined in the modules.c
+ files).
Normally there are no lower level modules, since
+ On
).
This module provides authentication front-ends such as
file
value.
The
Each line of the user file contains a username followed by
- a colon, followed by the crypt()
encrypted
- password. The behavior of multiple occurrences of the same user is
- undefined.
The utility htpasswd
which is installed as part of the binary distribution, or which
can be found in src/support
, is used to maintain
- this password file. See the man
page for more
- details. In short:
Create a password file Filename
with
+ username
as the initial ID. It will prompt for
+ the password:
Create a password file 'Filename' with 'username' as the - initial ID. It will prompt for the password:
-Add or modify 'username2' in the password file 'Filename':
-Add or modify username2
in the password file
+ Filename
:
Note that searching large text files is very
inefficient;
Make sure that the
If you are using HTTP Digest Authentication, the htpasswd tool is not sufficient. + You have to use htdigest + instead. Note that you cannot mix user data for Digest Authentication + and Basic Authentication within the same file.
+ +Make sure that the
The
The group file is keyed on the username. The value for a @@ -40,12 +40,14 @@ of user groups for authentication belongs. There must be no whitespace within the value, and it must never contain any colons.
-Security: make sure that the
-
Make sure that the
Combining Group and Password DBM files: In some cases it is easier to manage a single database which contains both the @@ -55,18 +57,19 @@ of user groups for authentication accomplished by first setting the group and password files to point to the same DBM:
-The key for the single DBM is the username. The value consists of
-The password section contains the Unix crypt()
+
The password section contains the encrypted
password as before. This is followed by a colon and the comma
separated list of groups. Other data may optionally be left in the
DBM file after another colon; it is ignored by the authentication
@@ -81,47 +84,39 @@ AuthDBMUserFile /www/userbase
store passwords
Sets the type of database file that is used to store the passwords.
+ The default database type is determined at compile time. The
+ availability of other types of database files also depends on
+ compile-time settings. Sets the type of database file that is used to store the passwords.
-The default database type is determined at compile time. The
-availability of other types of database files also depends on
-compile-time settings. It is crucial that whatever program you use to create your password
-files is configured to use the same type of database. It is crucial that whatever program you use to create your password
+ files is configured to use the same type of database. Setting the Configuration
and
- modules.c
file if there is no userID
- or rule matching the supplied userID. If there is
- a userID and/or rule specified; the usual password and access
- checks will be applied and a failure will give an Authorization
- Required reply.Off
allows group authorization
+ to be passed on to lower level modules (as defined in the
+ modules.c
file) if there is no group found
+ for the the supplied userID. If there are any groups
+ specified, the usual checks will be applied and a failure will
+ give an Authentication Required reply.
So if a userID appears in the database of more than one module;
or if a valid
A common use for this is in conjunction with one of the
- auth providers; such as
By default, control is not passed on and an unknown userID
- or rule will result in an Authorization Required reply. Not
+ auth providers; such as .htpasswd
file.
By default, control is not passed on and an unknown group + will result in an Authentication Required reply. Not setting it thus keeps the system secure and forces an NCSA compliant behaviour.
-Security: Do consider the implications of allowing a user to - allow fall-through in his .htaccess file; and verify that this - is really what you want; Generally it is easier to just secure - a single .htpasswd file, than it is to secure a database which - might have more access interfaces.
+Do consider the implications of allowing a user to
+ allow fall-through in his .htaccess file; and verify that this
+ is really what you want; Generally it is easier to just secure
+ a single .htpasswd
file, than it is to secure a
+ database which might have more access interfaces.
This module is designed to be the fallback module, if you don't
+ have configured an authorization module like
+
Setting the Off
allows for authorization to be passed on
+ to lower level modules (as defined in the modules.c
+ files).
Normally there are no lower level modules, since
+ On
).
This module provides authorization capabilities so that
- authenticated users can be allowed or denied access to portions
- of the web site by group membership. Similar functionality is
- provided by
The
Each line of the group file contains a groupname followed by a - colon, followed by the member usernames separated by spaces. - Example:
+ colon, followed by the member usernames separated by spaces. -Note that searching large text files is very
- inefficient;
Make sure that the
Make sure that the
Setting the Configuration
and modules.c
file if
- there is no userID or rule matching
- the supplied userID. If there is a userID and/or rule specified; the
- usual password and access checks will be applied and a failure will
- give an Authorization Required reply.
Off
allows for
+ group authorization to be passed on to lower level modules (as defined
+ in the modules.c
files) if there is no
+ group matching the supplied userID.
- So if a valid
By default, control is not passed on and an unknown userID - or rule will result in an Authorization Required reply. Not +
By default, control is not passed on and an unknown group + will result in an Authentication Required reply. Not setting it thus keeps the system secure and forces an NCSA compliant behaviour.
-Security: Do consider the implications of allowing a user to - allow fall-through in his .htaccess file; and verify that this - is really what you want; Generally it is easier to just secure - a single .htpasswd file, than it is to secure a database which - might have more access interfaces.
+Do consider the implications of allowing a user to
+ allow fall-through in his .htaccess
file; and verify
+ that this is really what you want; Generally it is easier to just
+ secure a single .htpasswd
file, than it is to secure
+ a database which might have more access interfaces.
The
Allow from apache.org
Hosts whose names match, or end in, this string are allowed
access. Only complete components are matched, so the above
example will match foo.apache.org
but it will
not match fooapache.org
. This configuration will
cause the server to perform a reverse DNS lookup on the
client IP address, regardless of the setting of the
Allow from 10.1.2.3
An IP address of a host allowed access
Allow from 10.1
The first 1 to 3 bytes of an IP address, for subnet + restriction.
Allow from
- 10.1.0.0/255.255.0.0
A network a.b.c.d, and a netmask w.x.y.z. For more + fine-grained subnet restriction.
Allow from 10.1.0.0/16
Similar to the previous case, except the netmask consists of + nnn high-order 1 bits.
Note that the last three examples above match exactly the
@@ -131,43 +140,39 @@ server
Allow from
- env=
env-variable is specified, then the request is
- allowed access if the environment variable env-variable
+ env=env-variable is specified, then the request is
+ allowed access if the environment variable env-variable
exists. The server provides the ability to set environment
variables in a flexible way based on characteristics of the client
request using the directives provided by
- User-Agent
(browser type), Referer
, or
other HTTP request header fields.
In this case, browsers with a user-agent string beginning
with KnockKnock/2.0
will be allowed access, and all
others will be denied.
The
Deny,Allow
Allow,Deny
Mutual-failure
Keywords may only be separated by a comma; no whitespace is +
Keywords may only be separated by a comma; no whitespace is
allowed between them. Note that in all cases every
In the following example, all hosts in the apache.org domain are allowed access; all other hosts are denied access.
-In the next example, all hosts in the apache.org domain are allowed access, except for the hosts which are in the @@ -255,11 +255,11 @@ evaluated. in the apache.org domain are denied access because the default state is to deny access to the server.
-On the other hand, if the Deny,Allow
, all hosts will
@@ -275,13 +275,15 @@ evaluated.
access to a part of the server even in the absence of accompanying
will deny all access to the /www
directory
because the default access state will be set to
@@ -303,7 +305,6 @@ evaluated.
href="../sections.html">How Directory, Location and Files sections
work.
This module provides authorization capabilities so that
+ authenticated users can be allowed or denied access to portions
+ of the web site. Require user
+ directive. Alternatively require valid-user
can be used to
+ grant access to all successfully authenticated users.
Setting the Off
allows for
+ user authorization to be passed on to lower level modules (as defined
+ in the modules.c
files) if there is no
+ user matching the supplied userID.
By default, control is not passed on and an unknown user
+ will result in an Authentication Required reply. Not
+ setting it to Off
thus keeps the system secure and forces
+ an NCSA compliant behaviour.