]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_userdir.xml
Woops. I meant <note>, not <example>.
[apache] / docs / manual / mod / mod_userdir.xml
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/xsl" href="../style/manual.xsl"?>
3 <modulesynopsis>
4
5 <name>mod_userdir</name>
6 <status>Base</status>
7 <description>This module provides for user-specific
8 directories.</description>
9 <identifier>userdir_module</identifier>
10 <sourcefile>mod_userdir.c</sourcefile>
11
12 <summary>
13 </summary>
14
15
16 <directivesynopsis>
17
18 <name>UserDir</name>
19 <description>Sets the directory from which to serve files when requests
20 for a particular user are received, denoted by requests containing
21 <em>~username</em>, such as 
22 <em>http://server.example.com/~bob/</em></description>
23 <syntax>UserDir <em>directory-filename</em></syntax>
24 <default>UserDir <em>public_html</em></default>
25 <contextlist><context>server config</context> <context>virtual
26 host</context></contextlist>
27 <compatibility>All forms except the <code>UserDir public_html</code>
28 form are only available in Apache 1.1 or above. Use of the 
29 <code>enabled</code> keyword, or <code>disabled</code> with a
30 list of usernames, is only available in Apache 1.3 and
31 above.</compatibility>
32
33 <usage>
34
35     <p>The <directive>UserDir</directive> directive sets the real
36     directory in a user's home directory to use when a request for a
37     document for a user is received. <em>Directory-filename</em> is
38     one of the following:</p>
39
40     <ul>
41       <li>The name of a directory or a pattern such as those shown
42       below.</li>
43
44       <li>The keyword <code>disabled</code>. This turns off
45       <em>all</em> username-to-directory translations except those
46       explicitly named with the <code>enabled</code> keyword (see
47       below).</li>
48
49       <li>The keyword <code>disabled</code> followed by a
50       space-delimited list of usernames. Usernames that appear in
51       such a list will <em>never</em> have directory translation
52       performed, even if they appear in an <code>enabled</code>
53       clause.</li>
54
55       <li>The keyword <code>enabled</code> followed by a
56       space-delimited list of usernames. These usernames will have
57       directory translation performed even if a global disable is
58       in effect, but not if they also appear in a
59       <code>disabled</code> clause.</li>
60     </ul>
61
62     <p>If neither the <code>enabled</code> nor the
63     <code>disabled</code> keywords appear in the
64     <code>Userdir</code> directive, the argument is treated as a
65     filename pattern, and is used to turn the name into a directory
66     specification. A request for
67     <code>http://www.foo.com/~bob/one/two.html</code> will be
68     translated to:</p>
69
70 <table>
71 <tr><th>UserDir directive used</th>
72 <th>Translated path</th></tr>
73 <tr><td>UserDir public_html</td><td>~bob/public_html/one/two.html</td></tr>
74 <tr><td>UserDir /usr/web</td><td>/usr/web/bob/one/two.html</td></tr>
75 <tr><td>UserDir /home/*/www</td><td>/home/bob/www/one/two.html</td></tr>
76 </table>
77
78     <p>The following directives will send redirects to the client:</p> 
79
80 <table>
81 <tr><th>UserDir directive used</th>
82 <th>Translated path</th></tr>
83 <tr><td>UserDir http://www.foo.com/users</td><td>http://www.foo.com/users/bob/one/two.html</td></tr>
84 <tr><td>UserDir
85 http://www.foo.com/*/usr</td><td>http://www.foo.com/bob/usr/one/two.html</td></tr>
86 <tr><td>UserDir
87 http://www.foo.com/~*/</td><td>http://www.foo.com/~bob/one/two.html</td></tr>
88 </table> 
89
90 <note>
91       <strong>Be careful when using this directive; for instance,
92       <code>"UserDir ./"</code> would map
93       <code>"/~root"</code> to <code>"/"</code> - which is probably
94       undesirable. If you are running Apache 1.3 or above, it is
95       strongly recommended that your configuration include a
96       "<code>UserDir disabled root</code>" declaration.
97       See also the <directive module="core">Directory</directive>
98       directive and the <a href="../misc/security_tips.html">Security
99       Tips</a> page for more information.</strong>
100 </note>
101
102 </usage>
103
104 </directivesynopsis>
105 </modulesynopsis>
106
107