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 - 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</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_auth.html" title="English"> en </a> |
25 <a href="../ja/mod/mod_auth.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User authentication using text files</td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>auth_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_auth.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 allows the use of HTTP Basic Authentication to
35 restrict access by looking up users in plain text password and
36 group files. Similar functionality and greater scalability is
37 provided by <code class="module"><a href="../mod/mod_auth_dbm.html">mod_auth_dbm</a></code>. HTTP Digest
38 Authentication is provided by <code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code>.</p>
40 <div id="quickview"><h3 class="directives">Directives</h3>
42 <li><img alt="" src="../images/down.gif" /> <a href="#authauthoritative">AuthAuthoritative</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#authgroupfile">AuthGroupFile</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#authuserfile">AuthUserFile</a></li>
48 <li><code class="directive"><a href="../mod/core.html#require">Require</a></code></li>
49 <li><code class="directive"><a href="../mod/core.html#satisfy">Satisfy</a></code></li>
50 <li><code class="directive"><a href="../mod/core.html#authname">AuthName</a></code></li>
51 <li><code class="directive"><a href="../mod/core.html#authtype">AuthType</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="AuthAuthoritative" id="AuthAuthoritative">AuthAuthoritative</a> <a name="authauthoritative" id="authauthoritative">Directive</a></h2>
56 <table class="directive">
57 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets whether authorization and authentication are
58 passed to lower level modules</td></tr>
59 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthAuthoritative On|Off</code></td></tr>
60 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthAuthoritative 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>Base</td></tr>
64 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth</td></tr>
66 <p>Setting the <code class="directive">AuthAuthoritative</code> directive
67 explicitly to <code>Off</code> allows for both authentication and
68 authorization to be passed on to lower level modules (as defined in the
69 <code>modules.c</code> files) if there is <strong>no userID</strong>
70 or <strong>rule</strong> matching the supplied userID. If there is a
71 userID and/or rule specified; the usual password and access checks
72 will be applied and a failure will give an "Authentication Required"
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">AuthAuthoritative</code> setting.</p>
81 <p>A common use for this is in conjunction with one of the
82 database modules; such as <code class="module"><a href="../mod/mod_auth_dbm.html">mod_auth_dbm</a></code>,
83 <code>mod_auth_msql</code>, and <code class="module"><a href="../mod/mod_auth_anon.html">mod_auth_anon</a></code>.
84 These modules supply the bulk of the user credential checking; but
85 a few (administrator) related accesses fall through to a lower
86 level with a well protected <code class="directive"><a href="#authuserfile">AuthUserFile</a></code>.</p>
88 <p>By default control is not passed on and an unknown userID or
89 rule will result in an "Authentication Required" reply. Not setting
90 it thus keeps the system secure and forces an NCSA compliant
93 <div class="warning"><h3>Security</h3>
94 <p>Do consider the implications of allowing a user to allow
95 fall-through in his .htaccess file; and verify that this is really
96 what you want; Generally it is easier to just secure a single
97 .htpasswd file, than it is to secure a database such as mSQL.
98 Make sure that the <code class="directive"><a href="#authuserfile">AuthUserFile</a></code> and the <code class="directive"><a href="#authgroupfile">AuthGroupFile</a></code> are stored outside the document tree of
99 the web-server; do <em>not</em> put them in the directory that they
100 protect. Otherwise, clients will be able to download the <code class="directive"><a href="#authuserfile">AuthUserFile</a></code> and the <code class="directive"><a href="#authgroupfile">AuthGroupFile</a></code>.</p>
104 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
105 <div class="directive-section"><h2><a name="AuthGroupFile" id="AuthGroupFile">AuthGroupFile</a> <a name="authgroupfile" id="authgroupfile">Directive</a></h2>
106 <table class="directive">
107 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the name of a text file containing the list
108 of user groups for authentication</td></tr>
109 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthGroupFile <var>file-path</var></code></td></tr>
110 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
111 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
112 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
113 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth</td></tr>
115 <p>The <code class="directive">AuthGroupFile</code> directive sets the
116 name of a textual file containing the list of user groups for user
117 authentication. <var>File-path</var> is the path to the group
118 file. If it is not absolute, it is treated as relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</p>
120 <p>Each line of the group file contains a groupname followed by a
121 colon, followed by the member usernames separated by spaces.</p>
123 <div class="example"><h3>Example:</h3><p><code>
124 mygroup: bob joe anne
127 <p>Note that searching large text files is <em>very</em>
128 inefficient; <code class="directive"><a href="../mod/mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code> provides a much better performance.</p>
130 <div class="warning"><h3>Security</h3>
131 <p>Make sure that the <code class="directive">AuthGroupFile</code> is
132 stored outside the document tree of the web-server; do <em>not</em>
133 put it in the directory that it protects. Otherwise, clients may
134 be able to download the <code class="directive">AuthGroupFile</code>.</p>
138 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
139 <div class="directive-section"><h2><a name="AuthUserFile" id="AuthUserFile">AuthUserFile</a> <a name="authuserfile" id="authuserfile">Directive</a></h2>
140 <table class="directive">
141 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the name of a text file containing the list of users and
142 passwords for authentication</td></tr>
143 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthUserFile <var>file-path</var></code></td></tr>
144 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
145 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
146 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
147 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth</td></tr>
149 <p>The <code class="directive">AuthUserFile</code> directive sets the name
150 of a textual file containing the list of users and passwords for
151 user authentication. <var>File-path</var> is the path to the user
152 file. If it is not absolute (<em>i.e.</em>, if it doesn't begin
153 with a slash), it is treated as relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</p>
155 <p>Each line of the user file contains a username followed by
156 a colon, followed by the encrypted password. If the same user
157 ID is defined multiple times, <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code> will
158 use the first occurrence to verify the password.</p>
160 <p>The utility <code class="program"><a href="../programs/htpasswd.html">htpasswd</a></code>
161 which is installed as part of the binary distribution, or which
162 can be found in <code>src/support</code>, is used to maintain
163 this password file. See the <a href="../programs/htpasswd.html">man
164 page</a> for more details. In short:</p>
166 <p>Create a password file <code>Filename</code> with
167 <code>username</code> as the initial ID. It will prompt for the
170 <div class="example"><p><code>
171 htpasswd -c Filename username
174 <p>Add or modify <code>username2</code> in the password file
175 <code>Filename</code>:</p>
177 <div class="example"><p><code>
178 htpasswd Filename username2
181 <p>Note that searching large text files is <em>very</em>
182 inefficient; <code class="directive"><a href="../mod/mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code> should be used
185 <div class="warning"><h3>Security</h3>
186 <p>Make sure that the <code class="directive">AuthUserFile</code> is
187 stored outside the document tree of the web-server. Do
188 <strong>not</strong> put it in the directory that it protects.
189 Otherwise, clients may be able to download the
190 <code class="directive">AuthUserFile</code>.</p>
195 <div class="bottomlang">
196 <p><span>Available Languages: </span><a href="../en/mod/mod_auth.html" title="English"> en </a> |
197 <a href="../ja/mod/mod_auth.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
198 </div><div id="footer">
199 <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>
200 <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>