]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_userdir.html.en
Merge in APR[-util] macros from branches/trunk-buildconf-noapr
[apache] / docs / manual / mod / mod_userdir.html.en
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 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>mod_userdir - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
24 <div id="path">
25 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_userdir</h1>
28 <div class="toplang">
29 <p><span>Available Languages: </span><a href="../en/mod/mod_userdir.html" title="English">&nbsp;en&nbsp;</a> |
30 <a href="../fr/mod/mod_userdir.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
31 <a href="../ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
32 <a href="../ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
33 <a href="../tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
34 </div>
35 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User-specific directories</td></tr>
36 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
37 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>userdir_module</td></tr>
38 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_userdir.c</td></tr></table>
39 <h3>Summary</h3>
40
41 <p>This module allows user-specific directories to be accessed using the
42 <code>http://example.com/~user/</code> syntax.</p>
43 </div>
44 <div id="quickview"><h3 class="directives">Directives</h3>
45 <ul id="toc">
46 <li><img alt="" src="../images/down.gif" /> <a href="#userdir">UserDir</a></li>
47 </ul>
48 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_userdir">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_userdir">Report a bug</a></li></ul><h3>See also</h3>
49 <ul class="seealso">
50 <li><a href="../urlmapping.html">Mapping URLs to the
51 Filesystem</a></li>
52 <li><a href="../howto/public_html.html">public_html
53 tutorial</a></li>
54 <li><a href="#comments_section">Comments</a></li></ul></div>
55
56 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
57 <div class="directive-section"><h2><a name="UserDir" id="UserDir">UserDir</a> <a name="userdir" id="userdir">Directive</a></h2>
58 <table class="directive">
59 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the user-specific directories</td></tr>
60 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UserDir <em>directory-filename</em> [<em>directory-filename</em>] ...
61 </code></td></tr>
62 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</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_userdir</td></tr>
65 </table>
66
67     <p>The <code class="directive">UserDir</code> directive sets the real
68     directory in a user's home directory to use when a request for a
69     document for a user is received. <em>Directory-filename</em> is
70     one of the following:</p>
71
72     <ul>
73       <li>The name of a directory or a pattern such as those shown
74       below.</li>
75
76       <li>The keyword <code>disabled</code>. This turns off
77       <em>all</em> username-to-directory translations except those
78       explicitly named with the <code>enabled</code> keyword (see
79       below).</li>
80
81       <li>The keyword <code>disabled</code> followed by a
82       space-delimited list of usernames. Usernames that appear in
83       such a list will <em>never</em> have directory translation
84       performed, even if they appear in an <code>enabled</code>
85       clause.</li>
86
87       <li>The keyword <code>enabled</code> followed by a
88       space-delimited list of usernames. These usernames will have
89       directory translation performed even if a global disable is
90       in effect, but not if they also appear in a
91       <code>disabled</code> clause.</li>
92     </ul>
93
94     <p>If neither the <code>enabled</code> nor the
95     <code>disabled</code> keywords appear in the
96     <code class="directive">Userdir</code> directive, the argument is treated as a
97     filename pattern, and is used to turn the name into a directory
98     specification. A request for
99     <code>http://www.example.com/~bob/one/two.html</code> will be
100     translated to:</p>
101
102     <table>
103       <tr><th>UserDir directive used</th>
104           <th>Translated path</th></tr>
105       <tr><td>UserDir public_html</td>
106           <td>~bob/public_html/one/two.html</td></tr>
107       <tr><td>UserDir /usr/web</td>
108           <td>/usr/web/bob/one/two.html</td></tr>
109       <tr><td>UserDir /home/*/www</td>
110           <td>/home/bob/www/one/two.html</td></tr>
111     </table>
112
113     <p>The following directives will send redirects to the client:</p>
114
115     <table>
116       <tr><th>UserDir directive used</th>
117           <th>Translated path</th></tr>
118       <tr><td>UserDir http://www.example.com/users</td>
119           <td>http://www.example.com/users/bob/one/two.html</td></tr>
120       <tr><td>UserDir http://www.example.com/*/usr</td>
121           <td>http://www.example.com/bob/usr/one/two.html</td></tr>
122       <tr><td>UserDir http://www.example.com/~*/</td>
123           <td>http://www.example.com/~bob/one/two.html</td></tr>
124     </table>
125
126     <div class="note">
127       <strong>Be careful when using this directive; for instance,
128       <code>"UserDir ./"</code> would map <code>"/~root"</code> to
129       <code>"/"</code> - which is probably undesirable. It is strongly
130       recommended that your configuration include a "<code>UserDir
131       disabled root</code>" declaration.  See also the <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> directive and the <a href="../misc/security_tips.html">Security Tips</a> page for
132       more information.</strong>
133     </div>
134
135     <p>Additional examples:</p>
136
137     <p>To allow a few users to have <code>UserDir</code> directories, but
138     not anyone else, use the following:</p>
139
140     <pre class="prettyprint lang-config">UserDir disabled
141 UserDir enabled user1 user2 user3</pre>
142
143
144     <p>To allow most users to have <code>UserDir</code> directories, but
145     deny this to a few, use the following:</p>
146
147     <pre class="prettyprint lang-config">UserDir disabled user4 user5 user6</pre>
148
149
150     <p>It is also possible to specify alternative user directories.
151     If you use a command like:</p>
152
153     <pre class="prettyprint lang-config">UserDir "public_html" "/usr/web" "http://www.example.com/"</pre>
154
155
156     <p>With a request for
157     <code>http://www.example.com/~bob/one/two.html</code>, will try to
158     find the page at <code>~bob/public_html/one/two.html</code> first, then
159     <code>/usr/web/bob/one/two.html</code>, and finally it will send a
160     redirect to <code>http://www.example.com/bob/one/two.html</code>.</p>
161
162     <p>If you add a redirect, it must be the last alternative in the list.
163     Apache httpd cannot determine if the redirect succeeded or not, so if you have
164     the redirect earlier in the list, that will always be the alternative
165     that is used.</p>
166
167     <p>User directory substitution is not active by default in versions
168     2.1.4 and later.  In earlier versions, <code>UserDir public_html</code>
169     was assumed if no <code class="directive">UserDir</code>
170     directive was present.</p>
171
172     <div class="note"><h3>Merging details</h3>
173     <p> Lists of specific enabled and disabled users are replaced, not merged,
174     from global to virtual host scope</p></div>
175
176
177 <h3>See also</h3>
178 <ul>
179 <li>
180   <a href="../howto/public_html.html">Per-user web directories tutorial</a>
181 </li>
182 </ul>
183 </div>
184 </div>
185 <div class="bottomlang">
186 <p><span>Available Languages: </span><a href="../en/mod/mod_userdir.html" title="English">&nbsp;en&nbsp;</a> |
187 <a href="../fr/mod/mod_userdir.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
188 <a href="../ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
189 <a href="../ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
190 <a href="../tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
191 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
192 <script type="text/javascript"><!--//--><![CDATA[//><!--
193 var comments_shortname = 'httpd';
194 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_userdir.html';
195 (function(w, d) {
196     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
197         d.write('<div id="comments_thread"><\/div>');
198         var s = d.createElement('script');
199         s.type = 'text/javascript';
200         s.async = true;
201         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
202         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
203     }
204     else {
205         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
206     }
207 })(window, document);
208 //--><!]]></script></div><div id="footer">
209 <p class="apache">Copyright 2017 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>
210 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
211 if (typeof(prettyPrint) !== 'undefined') {
212     prettyPrint();
213 }
214 //--><!]]></script>
215 </body></html>