e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<?xml version="1.0"?>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_userdir.xml.meta">
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<name>mod_userdir</name>
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive<description>User-specific directories</description>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<status>Base</status>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<sourcefile>mod_userdir.c</sourcefile>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<identifier>userdir_module</identifier>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<summary>
e0cbf588b6280e9857b9d8756077d513e13a12b3slive<p>This module allows user-specific directories to be accessed using the
e0cbf588b6280e9857b9d8756077d513e13a12b3slive<code>http://example.com/~user/</code> syntax.</p>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen</summary>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive<seealso><a href="/urlmapping.html">Mapping URLs to the
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcsliveFilesystem</a></seealso>
f9f056cc901d76ce30456457a4f15fec1a42e8a7rbowen<seealso><a href="/howto/public_html.html">public_html
f9f056cc901d76ce30456457a4f15fec1a42e8a7rbowentutorial</a></seealso>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<directivesynopsis>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<name>UserDir</name>
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive<description>Location of the user-specific directories</description>
6924307fdd2b3c3efdc811c342a1d1419cd7b48enoodl<syntax>UserDir <em>directory-filename</em> [<em>directory-filename</em>] ...
6924307fdd2b3c3efdc811c342a1d1419cd7b48enoodl</syntax>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<contextlist><context>server config</context> <context>virtual
e213c78d4d5c360645156dab56938b3565ebe8c1rbowenhost</context></contextlist>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen<usage>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
d5d6e50ca44fba6138129059cc6ad3e544da31cfslive <p>The <directive>UserDir</directive> directive sets the real
d5d6e50ca44fba6138129059cc6ad3e544da31cfslive directory in a user's home directory to use when a request for a
d5d6e50ca44fba6138129059cc6ad3e544da31cfslive document for a user is received. <em>Directory-filename</em> is
d5d6e50ca44fba6138129059cc6ad3e544da31cfslive one of the following:</p>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <ul>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <li>The name of a directory or a pattern such as those shown
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen below.</li>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <li>The keyword <code>disabled</code>. This turns off
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <em>all</em> username-to-directory translations except those
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen explicitly named with the <code>enabled</code> keyword (see
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen below).</li>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <li>The keyword <code>disabled</code> followed by a
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen space-delimited list of usernames. Usernames that appear in
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen such a list will <em>never</em> have directory translation
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen performed, even if they appear in an <code>enabled</code>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen clause.</li>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <li>The keyword <code>enabled</code> followed by a
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen space-delimited list of usernames. These usernames will have
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen directory translation performed even if a global disable is
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen in effect, but not if they also appear in a
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <code>disabled</code> clause.</li>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen </ul>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <p>If neither the <code>enabled</code> nor the
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <code>disabled</code> keywords appear in the
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <code>Userdir</code> directive, the argument is treated as a
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen filename pattern, and is used to turn the name into a directory
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen specification. A request for
e8811b6d38f756b325446ded5d96857d13856511takashi <code>http://www.example.com/~bob/one/two.html</code> will be
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen translated to:</p>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
c4340001c9fb90a49ca509012015738abc5dda87nilgun <table>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><th>UserDir directive used</th>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <th>Translated path</th></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir public_html</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>~bob/public_html/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir /usr/web</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>/usr/web/bob/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir /home/*/www</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>/home/bob/www/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun </table>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>The following directives will send redirects to the client:</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <table>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><th>UserDir directive used</th>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <th>Translated path</th></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir http://www.example.com/users</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>http://www.example.com/users/bob/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir http://www.example.com/*/usr</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>http://www.example.com/bob/usr/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <tr><td>UserDir http://www.example.com/~*/</td>
c4340001c9fb90a49ca509012015738abc5dda87nilgun <td>http://www.example.com/~bob/one/two.html</td></tr>
c4340001c9fb90a49ca509012015738abc5dda87nilgun </table>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <note>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen <strong>Be careful when using this directive; for instance,
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive <code>"UserDir ./"</code> would map <code>"/~root"</code> to
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive <code>"/"</code> - which is probably undesirable. It is strongly
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive recommended that your configuration include a "<code>UserDir
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive disabled root</code>" declaration. See also the <directive
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive module="core">Directory</directive> directive and the <a
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive href="/misc/security_tips.html">Security Tips</a> page for
6eef889fc0b7cd42c4c8ca7e8e094dc2c0b030fcslive more information.</strong>
c4340001c9fb90a49ca509012015738abc5dda87nilgun </note>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>Additional examples:</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>To allow a few users to have <code>UserDir</code> directories, but
c4340001c9fb90a49ca509012015738abc5dda87nilgun not anyone else, use the following:</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh <highlight language="config">
2d94fe5813abab3b802f233b292b55acdf858a2chumbedoohUserDir disabled
2d94fe5813abab3b802f233b292b55acdf858a2chumbedoohUserDir enabled user1 user2 user3
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh </highlight>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>To allow most users to have <code>UserDir</code> directories, but
c4340001c9fb90a49ca509012015738abc5dda87nilgun deny this to a few, use the following:</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh <highlight language="config">
c4340001c9fb90a49ca509012015738abc5dda87nilgun UserDir disabled user4 user5 user6
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh </highlight>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>It is also possible to specify alternative user directories.
c4340001c9fb90a49ca509012015738abc5dda87nilgun If you use a command like:</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh <highlight language="config">
6074eff60771983cfaf537121319f91619b81027coar UserDir "public_html" "/usr/web" "http://www.example.com/"
2d94fe5813abab3b802f233b292b55acdf858a2chumbedooh </highlight>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>With a request for
c4340001c9fb90a49ca509012015738abc5dda87nilgun <code>http://www.example.com/~bob/one/two.html</code>, will try to
c4340001c9fb90a49ca509012015738abc5dda87nilgun find the page at <code>~bob/public_html/one/two.html</code> first, then
c4340001c9fb90a49ca509012015738abc5dda87nilgun <code>/usr/web/bob/one/two.html</code>, and finally it will send a
c4340001c9fb90a49ca509012015738abc5dda87nilgun redirect to <code>http://www.example.com/bob/one/two.html</code>.</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>If you add a redirect, it must be the last alternative in the list.
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen Apache httpd cannot determine if the redirect succeeded or not, so if you have
c4340001c9fb90a49ca509012015738abc5dda87nilgun the redirect earlier in the list, that will always be the alternative
c4340001c9fb90a49ca509012015738abc5dda87nilgun that is used.</p>
c4340001c9fb90a49ca509012015738abc5dda87nilgun
c4340001c9fb90a49ca509012015738abc5dda87nilgun <p>User directory substitution is not active by default in versions
c4340001c9fb90a49ca509012015738abc5dda87nilgun 2.1.4 and later. In earlier versions, <code>UserDir public_html</code>
c4340001c9fb90a49ca509012015738abc5dda87nilgun was assumed if no <directive module="mod_userdir">UserDir</directive>
c4340001c9fb90a49ca509012015738abc5dda87nilgun directive was present.</p>
945a9b081610f2b57759231e4cfad7aed62c9326slive
88ec2dad2d542c9454cc4b41fc4edb659694c1cecovener <note><title>Merging details</title>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p> Lists of specific enabled and disabled users are replaced, not merged,
88ec2dad2d542c9454cc4b41fc4edb659694c1cecovener from global to virtual host scope</p></note>
88ec2dad2d542c9454cc4b41fc4edb659694c1cecovener
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen</usage>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
c4340001c9fb90a49ca509012015738abc5dda87nilgun<seealso>
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen <a href="/howto/public_html.html">Per-user web directories tutorial</a>
c4340001c9fb90a49ca509012015738abc5dda87nilgun</seealso>
f9f056cc901d76ce30456457a4f15fec1a42e8a7rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen</directivesynopsis>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen</modulesynopsis>
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen
e213c78d4d5c360645156dab56938b3565ebe8c1rbowen