mod_auth_dbm.html revision 2de56243b49d1c39dbc467e3f9daab152c8691b8
876N/A<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
876N/A XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
876N/A This file is generated from xml source: DO NOT EDIT
876N/A XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
876N/A --><title>mod_auth_dbm- Apache HTTP Server</title><link href="/style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_auth_dbm</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Provides for user authentication using DBM
876N/A files</td></tr><tr><td><a href="module-dict.html#Status" class="help">Status:</a></td><td>Extension</td></tr><tr><td><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:</a></td><td>auth_dbm_module</td></tr></table></td></tr></table><h2>Summary</h2>
876N/A <p>This module provides for HTTP Basic Authentication, where
876N/A the usernames and passwords are stored in DBM type database
876N/A files. It is an alternative to the plain text password files
876N/A provided by <code><a href="mod_auth.html">mod_auth</a></code>.</p>
876N/A<h2>Directives</h2><ul><li><a href="#authdbmauthoritative">AuthDBMAuthoritative</a></li><li><a href="#authdbmgroupfile">AuthDBMGroupFile</a></li><li><a href="#authdbmtype">AuthDBMType</a></li><li><a href="#authdbmuserfile">AuthDBMUserFile</a></li></ul><p><strong>See also </strong></p><ul><li><a href="core.html#authname" class="directive"><code class="directive">AuthName</code></a></li><li><a href="core.html#authtype" class="directive"><code class="directive">AuthType</code></a></li><li><a href="core.html#require" class="directive"><code class="directive">Require</code></a></li><li><a href="core.html#satisfy" class="directive"><code class="directive">Satisfy</code></a></li></ul><hr/><h2><a name="AuthDBMAuthoritative">AuthDBMAuthoritative</a> <a name="authdbmauthoritative">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sets whether authentication and authorization will be
876N/Apasswed on to lower level modules</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>AuthDBMAuthoritative on|off</td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>AuthDBMAuthoritative on</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>AuthConfig</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Extension</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_auth_dbm</td></tr></table></td></tr></table>
876N/A
876N/A<blockquote><table><tr><td bgcolor="#e0e5f5">This information has not been updated to take into account the
876N/Anew module ordering techniques in Apache 2.0</td></tr></table></blockquote>
876N/A
876N/A <p>Setting the <code class="directive">AuthDBMAuthoritative</code>
876N/A directive explicitly to <strong>'off'</strong> allows for both
876N/A authentication and authorization to be passed on to lower level
876N/A modules (as defined in the <code>Configuration</code> and
876N/A <code>modules.c</code> file if there is <strong>no userID</strong>
876N/A or <strong>rule</strong> matching the supplied userID. If there is
876N/A a userID and/or rule specified; the usual password and access
876N/A checks will be applied and a failure will give an Authorization
876N/A Required reply.</p>
981N/A
876N/A <p>So if a userID appears in the database of more than one module;
876N/A or if a valid <a href="core.html#require" class="directive"><code class="directive">Require</code></a>
876N/A directive applies to more than one module; then the first module
876N/A will verify the credentials; and no access is passed on;
876N/A regardless of the <code class="directive">AuthAuthoritative</code> setting.</p>
876N/A
876N/A <p>A common use for this is in conjunction with one of the
876N/A basic auth modules; such as <code><a href="mod_auth.html">mod_auth</a></code>. Whereas this
876N/A DBM module supplies the bulk of the user credential checking; a
876N/A few (administrator) related accesses fall through to a lower
876N/A level with a well protected .htpasswd file.</p>
876N/A
876N/A <p>By default, control is not passed on and an unknown userID
876N/A or rule will result in an Authorization Required reply. Not
876N/A setting it thus keeps the system secure and forces an NCSA
876N/A compliant behaviour.</p>
876N/A
876N/A <p>Security: Do consider the implications of allowing a user to
876N/A allow fall-through in his .htaccess file; and verify that this
876N/A is really what you want; Generally it is easier to just secure
876N/A a single .htpasswd file, than it is to secure a database which
876N/A might have more access interfaces.</p>
876N/A<hr/><h2><a name="AuthDBMGroupFile">AuthDBMGroupFile</a> <a name="authdbmgroupfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sets the name of the database file containing the list
876N/Aof user groups for authentication</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>AuthDBMGroupFile <em>file-path</em></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>AuthConfig</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Extension</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_auth_dbm</td></tr></table></td></tr></table>
876N/A <p>The <code class="directive">AuthDBMGroupFile</code> directive sets the
876N/A name of a DBM file containing the list of user groups for user
876N/A authentication. <em>File-path</em> is the absolute path to the
876N/A group file.</p>
876N/A
876N/A <p>The group file is keyed on the username. The value for a
876N/A user is a comma-separated list of the groups to which the users
876N/A belongs. There must be no whitespace within the value, and it
876N/A must never contain any colons.</p>
876N/A
876N/A <p>Security: make sure that the
876N/A <code class="directive">AuthDBMGroupFile</code> is stored outside the
876N/A document tree of the web-server; do <em>not</em> put it in the
876N/A directory that it protects. Otherwise, clients will be able to
876N/A download the <code class="directive">AuthDBMGroupFile</code> unless
876N/A otherwise protected.</p>
876N/A
876N/A <p>Combining Group and Password DBM files: In some cases it is
876N/A easier to manage a single database which contains both the
876N/A password and group details for each user. This simplifies any
876N/A support programs that need to be written: they now only have to
876N/A deal with writing to and locking a single DBM file. This can be
876N/A accomplished by first setting the group and password files to
876N/A point to the same DBM:</p>
876N/A
876N/A<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
876N/AAuthDBMGroupFile /www/userbase<br>
876N/AAuthDBMUserFile /www/userbase
876N/A</code></td></tr></table></blockquote>
876N/A
876N/A <p>The key for the single DBM is the username. The value consists
876N/A of</p>
876N/A
876N/A<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>Unix Crypt-ed Password : List of Groups [ : (ignored)
876N/A ]</code></td></tr></table></blockquote>
876N/A
876N/A <p>The password section contains the Unix <code>crypt()</code>
876N/A password as before. This is followed by a colon and the comma
876N/A separated list of groups. Other data may optionally be left in the
876N/A DBM file after another colon; it is ignored by the authentication
876N/A module. This is what www.telescope.org uses for its combined
876N/A password and group database.</p>
876N/A<hr/><h2><a name="AuthDBMType">AuthDBMType</a> <a name="authdbmtype">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sets the type of database file that is used to
876N/Astore passwords</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>AuthDBMType default|SDBM|GDBM|DB</td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>AuthDBMType default</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>AuthConfig</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Extension</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_auth_dbm</td></tr><tr><td align="left" valign="top"><a href="directive-dict.html#Compatibility" class="help">Compatibility:</a></td><td>Available in version 2.0.30 and later.</td></tr></table></td></tr></table>
876N/A
876N/A<p>Sets the type of database file that is used to store the passwords.
876N/AThe default database type is determined at compile time. The
876N/Aavailability of other types of database files also depends on
876N/Acompile-time settings.</p>
876N/A
876N/A<p>It is crucial that whatever program you use to create your password
876N/Afiles is configured to use the same type of database.</p>
876N/A<hr/><h2><a name="AuthDBMUserFile">AuthDBMUserFile</a> <a name="authdbmuserfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sets thename of a database file containing the list of users and
876N/Apasswords for authentication</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>AuthDBMUserFile <em>file-path</em></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>directory, .htaccess</td></tr><tr><td><a href="directive-dict.html#Override" class="help">Override:</a></td><td>AuthConfig</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Extension</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_auth_dbm</td></tr></table></td></tr></table>
876N/A <p>The <code class="directive">AuthDBMUserFile</code> directive sets the
876N/A name of a DBM file containing the list of users and passwords for
876N/A user authentication. <em>File-path</em> is the absolute path to
876N/A the user file.</p>
876N/A
876N/A <p>The user file is keyed on the username. The value for a user is
876N/A the <code>crypt()</code> encrypted password, optionally followed
876N/A by a colon and arbitrary data. The colon and the data following it
876N/A will be ignored by the server.</p>
876N/A
876N/A <p>Security: make sure that the
876N/A <code class="directive">AuthDBMUserFile</code> is stored outside the
876N/A document tree of the web-server; do <em>not</em> put it in the
876N/A directory that it protects. Otherwise, clients will be able to
876N/A download the <code class="directive">AuthDBMUserFile</code>.</p>
876N/A
876N/A <p>Important compatibility note: The implementation of
876N/A "dbmopen" in the apache modules reads the string length of the
876N/A hashed values from the DBM data structures, rather than relying
876N/A upon the string being NULL-appended. Some applications, such as
876N/A the Netscape web server, rely upon the string being
876N/A NULL-appended, so if you are having trouble using DBM files
876N/A interchangeably between applications this may be a part of the
876N/A problem.</p>
876N/A
981N/A <p>A perl script called
981N/A <a href="/programs/dbmmanage.html">dbmmanage</a> is included with
981N/A Apache. This program can be used to create and update DBM
981N/A format password files for use with this module.</p>
981N/A<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></body></html>