mod_userdir.html.en revision 9c1260efa52c82c2a58e5b5f20cd6902563d95f5
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml version="1.0" encoding="ISO-8859-1"?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
8c81ebbdeed67059e7a1106d7c617543e901c3abyoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8c81ebbdeed67059e7a1106d7c617543e901c3abyoshiki This file is generated from xml source: DO NOT EDIT
8c81ebbdeed67059e7a1106d7c617543e901c3abyoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd -->
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<title>mod_userdir - Apache HTTP Server</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<body>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="page-header">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<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>
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz<p class="apache">Apache HTTP Server Version 2.3</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<img alt="" src="/images/feather.gif" /></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="path">
4b5981e276e93df97c34e4da05ca5cf8bbd937dand<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.3</a> &gt; <a href="./">Modules</a></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="page-content">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="preamble"><h1>Apache Module mod_userdir</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_userdir.html" title="English">&nbsp;en&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
e1e8390280254f7f0580d701e583f670643d4f3fnilgun<a href="/ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
e1e8390280254f7f0580d701e583f670643d4f3fnilgun<a href="/tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User-specific directories</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>userdir_module</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_userdir.c</td></tr></table>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<h3>Summary</h3>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
8c81ebbdeed67059e7a1106d7c617543e901c3abyoshiki<p>This module allows user-specific directories to be accessed using the
8c81ebbdeed67059e7a1106d7c617543e901c3abyoshiki<code>http://example.com/~user/</code> syntax.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="quickview"><h3 class="directives">Directives</h3>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<ul id="toc">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<li><img alt="" src="/images/down.gif" /> <a href="#userdir">UserDir</a></li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</ul>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<h3>See also</h3>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<ul class="seealso">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<li><a href="/urlmapping.html">Mapping URLs to the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndFilesystem</a></li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<li><a href="/howto/public_html.html">public_html
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtutorial</a></li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</ul></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="directive-section"><h2><a name="UserDir" id="UserDir">UserDir</a> <a name="userdir" id="userdir">Directive</a></h2>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<table class="directive">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the user-specific directories</td></tr>
f61ec47ec494705bd2d02b5b6fe021e5c193f2c8noodl<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UserDir <em>directory-filename</em> [<em>directory-filename</em>] ...
f61ec47ec494705bd2d02b5b6fe021e5c193f2c8noodl</code></td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_userdir</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive">UserDir</code> directive sets the real
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directory in a user's home directory to use when a request for a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive document for a user is received. <em>Directory-filename</em> is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive one of the following:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <ul>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>The name of a directory or a pattern such as those shown
06ba4a61654b3763ad65f52283832ebf058fdf1cslive below.</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>The keyword <code>disabled</code>. This turns off
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <em>all</em> username-to-directory translations except those
06ba4a61654b3763ad65f52283832ebf058fdf1cslive explicitly named with the <code>enabled</code> keyword (see
06ba4a61654b3763ad65f52283832ebf058fdf1cslive below).</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>The keyword <code>disabled</code> followed by a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive space-delimited list of usernames. Usernames that appear in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive such a list will <em>never</em> have directory translation
06ba4a61654b3763ad65f52283832ebf058fdf1cslive performed, even if they appear in an <code>enabled</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive clause.</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>The keyword <code>enabled</code> followed by a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive space-delimited list of usernames. These usernames will have
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directory translation performed even if a global disable is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive in effect, but not if they also appear in a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>disabled</code> clause.</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </ul>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If neither the <code>enabled</code> nor the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>disabled</code> keywords appear in the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>Userdir</code> directive, the argument is treated as a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive filename pattern, and is used to turn the name into a directory
06ba4a61654b3763ad65f52283832ebf058fdf1cslive specification. A request for
82178a3043043b8813c0d7288a06ca1b7d110d4atakashi <code>http://www.example.com/~bob/one/two.html</code> will be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive translated to:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <table>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><th>UserDir directive used</th>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <th>Translated path</th></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir public_html</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>~bob/public_html/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir /usr/web</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>/usr/web/bob/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir /home/*/www</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>/home/bob/www/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </table>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>The following directives will send redirects to the client:</p>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <table>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><th>UserDir directive used</th>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <th>Translated path</th></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir http://www.example.com/users</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>http://www.example.com/users/bob/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir http://www.example.com/*/usr</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>http://www.example.com/bob/usr/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <tr><td>UserDir http://www.example.com/~*/</td>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <td>http://www.example.com/~bob/one/two.html</td></tr>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </table>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <div class="note">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <strong>Be careful when using this directive; for instance,
3a6531f1fd50efd78381e5800802a1449096781eslive <code>"UserDir ./"</code> would map <code>"/~root"</code> to
3a6531f1fd50efd78381e5800802a1449096781eslive <code>"/"</code> - which is probably undesirable. It is strongly
3a6531f1fd50efd78381e5800802a1449096781eslive recommended that your configuration include a "<code>UserDir
97a9a944b5887e91042b019776c41d5dd74557aferikabele 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
3a6531f1fd50efd78381e5800802a1449096781eslive more information.</strong>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>Additional examples:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>To allow a few users to have <code>UserDir</code> directories, but
e1e8390280254f7f0580d701e583f670643d4f3fnilgun not anyone else, use the following:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <div class="example"><p><code>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun UserDir disabled<br />
e1e8390280254f7f0580d701e583f670643d4f3fnilgun UserDir enabled user1 user2 user3
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>To allow most users to have <code>UserDir</code> directories, but
e1e8390280254f7f0580d701e583f670643d4f3fnilgun deny this to a few, use the following:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <div class="example"><p><code>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun UserDir disabled user4 user5 user6
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>It is also possible to specify alternative user directories.
e1e8390280254f7f0580d701e583f670643d4f3fnilgun If you use a command like:</p>
e06675c51d084791089d79c3ac18aeae8dd465fcrbb
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <div class="example"><p><code>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun Userdir public_html /usr/web http://www.example.com/
e1e8390280254f7f0580d701e583f670643d4f3fnilgun </code></p></div>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>With a request for
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <code>http://www.example.com/~bob/one/two.html</code>, will try to
e1e8390280254f7f0580d701e583f670643d4f3fnilgun find the page at <code>~bob/public_html/one/two.html</code> first, then
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <code>/usr/web/bob/one/two.html</code>, and finally it will send a
e1e8390280254f7f0580d701e583f670643d4f3fnilgun redirect to <code>http://www.example.com/bob/one/two.html</code>.</p>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <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
e1e8390280254f7f0580d701e583f670643d4f3fnilgun the redirect earlier in the list, that will always be the alternative
e1e8390280254f7f0580d701e583f670643d4f3fnilgun that is used.</p>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun
e1e8390280254f7f0580d701e583f670643d4f3fnilgun <p>User directory substitution is not active by default in versions
e1e8390280254f7f0580d701e583f670643d4f3fnilgun 2.1.4 and later. In earlier versions, <code>UserDir public_html</code>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun was assumed if no <code class="directive"><a href="#userdir">UserDir</a></code>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun directive was present.</p>
25d005c58102474e06fb67d748273b161d7198d0pquerna
a5a2e98043365d3f5a8bb3c3cdfc252a4f11bf02nd <div class="note"><h3>Merging details</h3>
a5a2e98043365d3f5a8bb3c3cdfc252a4f11bf02nd <p> Lists of specific enabled and disabled users are replaced, not merged,
a5a2e98043365d3f5a8bb3c3cdfc252a4f11bf02nd from global to virtual host scope</p></div>
a5a2e98043365d3f5a8bb3c3cdfc252a4f11bf02nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<h3>See also</h3>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<ul>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun<li>
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen <a href="/howto/public_html.html">Per-user web directories tutorial</a>
e1e8390280254f7f0580d701e583f670643d4f3fnilgun</li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</ul>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="bottomlang">
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_userdir.html" title="English">&nbsp;en&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
e1e8390280254f7f0580d701e583f670643d4f3fnilgun<a href="/ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
e1e8390280254f7f0580d701e583f670643d4f3fnilgun<a href="/tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div><div id="footer">
9c1260efa52c82c2a58e5b5f20cd6902563d95f5rbowen<p class="apache">Copyright 2011 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>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<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>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</body></html>