]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_authz_owner.xml
mod_reqtimeout: Change the default to set some reasonable timeout values if loaded
[apache] / docs / manual / mod / mod_authz_owner.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_authz_owner.xml.meta">
24
25 <name>mod_authz_owner</name>
26 <description>Authorization based on file ownership</description>
27 <status>Extension</status>
28 <sourcefile>mod_authz_owner.c</sourcefile>
29 <identifier>authz_owner_module</identifier>
30 <compatibility>Available in Apache 2.1 and later</compatibility>
31
32 <summary>
33     <p>This module authorizes access to files by comparing the userid used
34     for HTTP authentication (the web userid) with the file-system owner or
35     group of the requested file. The supplied username and password
36     must be already properly verified by an authentication module,
37     such as <module>mod_auth_basic</module> or
38     <module>mod_auth_digest</module>. <module>mod_authz_owner</module>
39     recognizes two arguments for the <directive module="core"
40     >Require</directive> directive, <code>file-owner</code> and
41     <code>file-group</code>, as follows:</p>
42
43     <dl>
44       <dt><code>file-owner</code></dt>
45       <dd>The supplied web-username must match the system's name for the
46       owner of the file being requested. That is, if the operating system
47       says the requested file is owned by <code>jones</code>, then the
48       username used to access it through the web must be <code>jones</code>
49       as well.</dd>
50
51       <dt><code>file-group</code></dt>
52       <dd>The name of the system group that owns the file must be present
53       in a group database, which is provided, for example, by <module
54       >mod_authz_groupfile</module> or <module>mod_authz_dbm</module>,
55       and the web-username must be a member of that group. For example, if
56       the operating system says the requested file is owned by (system)
57       group <code>accounts</code>, the group <code>accounts</code> must
58       appear in the group database and the web-username used in the request
59       must be a member of that group.</dd>
60     </dl>
61
62     <note><title>Note</title>
63       <p>If <module>mod_authz_owner</module> is used in order to authorize
64       a resource that is not actually present in the filesystem
65       (<em>i.e.</em> a virtual resource), it will deny the access.</p>
66
67       <p>Particularly it will never authorize <a
68       href="../content-negotiation.html#multiviews">content negotiated
69       "MultiViews"</a> resources.</p>
70     </note>
71 </summary>
72 <seealso><directive module="mod_authz_core">Require</directive></seealso>
73
74 <section id="examples"><title>Configuration Examples</title>
75
76     <section id="examples.file-owner"><title>Require file-owner</title>
77       <p>Consider a multi-user system running the Apache Web server, with
78       each user having his or her own files in <code
79       >~/public_html/private</code>. Assuming that there is a single
80       <directive module="mod_authn_dbm">AuthDBMUserFile</directive> database
81       that lists all of their web-usernames, and that these usernames match
82       the system's usernames that actually own the files on the server, then
83       the following stanza would allow only the user himself access to his
84       own files. User <code>jones</code> would not be allowed to access
85       files in <code>/home/smith/public_html/private</code> unless they
86       were owned by <code>jones</code> instead of <code>smith</code>.</p>
87
88       <example>
89         &lt;Directory /home/*/public_html/private&gt;<br />
90         <indent>
91           AuthType Basic<br />
92           AuthName MyPrivateFiles<br />
93           AuthBasicProvider dbm<br />
94           AuthDBMUserFile /usr/local/apache2/etc/.htdbm-all<br />
95           Require file-owner<br />
96         </indent>
97         &lt;/Directory&gt;
98       </example>
99     </section>
100
101     <section id="examples.file-group"><title>Require file-group</title>
102       <p>Consider a system similar to the one described above, but with
103       some users that share their project files in
104       <code>~/public_html/project-foo</code>. The files are owned by the
105       system group <code>foo</code> and there is a single <directive
106       module="mod_authz_dbm">AuthDBMGroupFile</directive> database that
107       contains all of the web-usernames and their group membership,
108       <em>i.e.</em> they must be at least member of a group named
109       <code>foo</code>. So if <code>jones</code> and <code>smith</code>
110       are both member of the group <code>foo</code>, then both will be
111       authorized to access the <code>project-foo</code> directories of
112       each other.</p>
113
114       <example>
115         &lt;Directory /home/*/public_html/project-foo&gt;<br />
116         <indent>
117           AuthType Basic<br />
118           AuthName "Project Foo Files"<br />
119           AuthBasicProvider dbm<br />
120           <br />
121           # combined user/group database<br />
122           AuthDBMUserFile  /usr/local/apache2/etc/.htdbm-all<br />
123           AuthDBMGroupFile /usr/local/apache2/etc/.htdbm-all<br />
124           <br />
125           Satisfy All<br />
126           Require file-group<br />
127         </indent>
128         &lt;/Directory&gt;
129       </example>
130     </section>
131 </section>
132
133 </modulesynopsis>