1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>mod_auth_dbm - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.0</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_auth_dbm</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_auth_dbm.html" title="English"> en </a></p>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for user authentication using DBM
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>auth_dbm_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_auth_dbm.c</td></tr>
31 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available only in versions prior to 2.1</td></tr></table>
34 <p>This module provides for HTTP Basic Authentication, where
35 the usernames and passwords are stored in DBM type database
36 files. It is an alternative to the plain text password files
37 provided by <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code>.</p>
39 <div id="quickview"><h3 class="directives">Directives</h3>
41 <li><img alt="" src="../images/down.gif" /> <a href="#authdbmauthoritative">AuthDBMAuthoritative</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#authdbmgroupfile">AuthDBMGroupFile</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#authdbmtype">AuthDBMType</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#authdbmuserfile">AuthDBMUserFile</a></li>
48 <li><code class="directive"><a href="../mod/core.html#authname">AuthName</a></code></li>
49 <li><code class="directive"><a href="../mod/core.html#authtype">AuthType</a></code></li>
50 <li><code class="directive"><a href="../mod/core.html#require">Require</a></code></li>
51 <li><code class="directive"><a href="../mod/core.html#satisfy">Satisfy</a></code></li>
54 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
55 <div class="directive-section"><h2><a name="AuthDBMAuthoritative" id="AuthDBMAuthoritative">AuthDBMAuthoritative</a> <a name="authdbmauthoritative" id="authdbmauthoritative">Directive</a></h2>
56 <table class="directive">
57 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets whether authentication and authorization will be
58 passed on to lower level modules</td></tr>
59 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBMAuthoritative On|Off</code></td></tr>
60 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDBMAuthoritative On</code></td></tr>
61 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
62 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
63 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
64 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_dbm</td></tr>
66 <p>Setting the <code class="directive">AuthDBMAuthoritative</code>
67 directive explicitly to <code>Off</code> allows for both
68 authentication and authorization to be passed on to lower level
69 modules (as defined in the <code>modules.c</code> files) if there
70 is <strong>no userID</strong> or <strong>rule</strong> matching the
71 supplied userID. If there is a userID and/or rule specified; the
72 usual password and access checks will be applied and a failure will
73 give an "Authentication Required" reply.</p>
75 <p>So if a userID appears in the database of more than one module;
76 or if a valid <code class="directive"><a href="../mod/core.html#require">Require</a></code>
77 directive applies to more than one module; then the first module
78 will verify the credentials; and no access is passed on;
79 regardless of the <code class="directive">AuthDBMAuthoritative</code>
82 <p>A common use for this is in conjunction with one of the
83 basic auth modules; such as <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code>. Whereas this
84 DBM module supplies the bulk of the user credential checking; a
85 few (administrator) related accesses fall through to a lower
86 level with a well protected <code>.htpasswd</code> file.</p>
88 <p>By default, control is not passed on and an unknown userID
89 or rule will result in an "Authentication Required" reply. Not
90 setting it thus keeps the system secure and forces an NCSA
91 compliant behaviour.</p>
93 <div class="warning"><h3>Security:</h3>
94 <p>Do consider the implications of allowing a user to allow
95 fall-through in his <code>.htaccess</code> file; and verify that this
96 is really what you want; Generally it is easier to just secure
97 a single <code>.htpasswd</code> file, than it is to secure a
98 database which might have more access interfaces.</p>
102 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
103 <div class="directive-section"><h2><a name="AuthDBMGroupFile" id="AuthDBMGroupFile">AuthDBMGroupFile</a> <a name="authdbmgroupfile" id="authdbmgroupfile">Directive</a></h2>
104 <table class="directive">
105 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the name of the database file containing the list
106 of user groups for authentication</td></tr>
107 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBMGroupFile <var>file-path</var></code></td></tr>
108 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
109 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
110 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
111 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_dbm</td></tr>
113 <p>The <code class="directive">AuthDBMGroupFile</code> directive sets the
114 name of a DBM file containing the list of user groups for user
115 authentication. <var>File-path</var> is the absolute path to the
118 <p>The group file is keyed on the username. The value for a
119 user is a comma-separated list of the groups to which the users
120 belongs. There must be no whitespace within the value, and it
121 must never contain any colons.</p>
123 <p>Security: make sure that the
124 <code class="directive">AuthDBMGroupFile</code> is stored outside the
125 document tree of the web-server; do <em>not</em> put it in the
126 directory that it protects. Otherwise, clients will be able to
127 download the <code class="directive">AuthDBMGroupFile</code> unless
128 otherwise protected.</p>
130 <p>Combining Group and Password DBM files: In some cases it is
131 easier to manage a single database which contains both the
132 password and group details for each user. This simplifies any
133 support programs that need to be written: they now only have to
134 deal with writing to and locking a single DBM file. This can be
135 accomplished by first setting the group and password files to
136 point to the same DBM:</p>
138 <div class="example"><p><code>
139 AuthDBMGroupFile /www/userbase<br />
140 AuthDBMUserFile /www/userbase
143 <p>The key for the single DBM is the username. The value consists
146 <div class="example"><p><code>
147 <var>Unix Crypt-ed Password</var>:<var>List of Groups</var>[:(ignored)]
150 <p>The password section contains the encrypted password as before.
151 This is followed by a colon and the comma separated list of groups.
152 Other data may optionally be left in the DBM file after another colon;
153 it is ignored by the authentication module. This is what
154 www.telescope.org uses for its combined password and group database.</p>
157 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
158 <div class="directive-section"><h2><a name="AuthDBMType" id="AuthDBMType">AuthDBMType</a> <a name="authdbmtype" id="authdbmtype">Directive</a></h2>
159 <table class="directive">
160 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the type of database file that is used to
161 store passwords</td></tr>
162 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBMType default|SDBM|GDBM|NDBM|DB</code></td></tr>
163 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDBMType default</code></td></tr>
164 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
165 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
166 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
167 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_dbm</td></tr>
168 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later.</td></tr>
170 <p>Sets the type of database file that is used to store the passwords.
171 The default database type is determined at compile time. The
172 availability of other types of database files also depends on
173 <a href="../install.html#dbm">compile-time settings</a>.</p>
175 <p>It is crucial that whatever program you use to create your password
176 files is configured to use the same type of database.</p>
179 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
180 <div class="directive-section"><h2><a name="AuthDBMUserFile" id="AuthDBMUserFile">AuthDBMUserFile</a> <a name="authdbmuserfile" id="authdbmuserfile">Directive</a></h2>
181 <table class="directive">
182 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets thename of a database file containing the list of users and
183 passwords for authentication</td></tr>
184 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDBMUserFile <var>file-path</var></code></td></tr>
185 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
186 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
187 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
188 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_dbm</td></tr>
190 <p>The <code class="directive">AuthDBMUserFile</code> directive sets the
191 name of a DBM file containing the list of users and passwords for
192 user authentication. <var>File-path</var> is the absolute path to
195 <p>The user file is keyed on the username. The value for a user is
196 the encrypted password, optionally followed by a colon and arbitrary
197 data. The colon and the data following it will be ignored by the
200 <div class="warning"><h3>Security:</h3>
201 <p>Make sure that the <code class="directive">AuthDBMUserFile</code> is stored
202 outside the document tree of the web-server; do <em>not</em> put it in
203 the directory that it protects. Otherwise, clients will be able to
204 download the <code class="directive">AuthDBMUserFile</code>.</p>
207 <p>Important compatibility note: The implementation of
208 "dbmopen" in the apache modules reads the string length of the
209 hashed values from the DBM data structures, rather than relying
210 upon the string being NULL-appended. Some applications, such as
211 the Netscape web server, rely upon the string being
212 NULL-appended, so if you are having trouble using DBM files
213 interchangeably between applications this may be a part of the
216 <p>A perl script called
217 <code class="program"><a href="../programs/dbmmanage.html">dbmmanage</a></code> is included with
218 Apache. This program can be used to create and update DBM
219 format password files for use with this module.</p>
223 <div class="bottomlang">
224 <p><span>Available Languages: </span><a href="../en/mod/mod_auth_dbm.html" title="English"> en </a></p>
225 </div><div id="footer">
226 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
227 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>