1<?xml version="1.0" encoding="UTF-8"?>
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="ja" xml:lang="ja"><head><!--
4        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5              This file is generated from xml source: DO NOT EDIT
6        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7      -->
8<title>ユーザ毎のウェブディレクトリ - Apache HTTP サーバ</title>
9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11<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" />
12<script src="/style/scripts/prettify.js" type="text/javascript">
13</script>
14
15<link href="/images/favicon.ico" rel="shortcut icon" /></head>
16<body id="manual-page"><div id="page-header">
17<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p>
18<p class="apache">Apache HTTP サーバ バージョン 2.2</p>
19<img alt="" src="/images/feather.gif" /></div>
20<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
21<div id="path">
22<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP サーバ</a> &gt; <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> &gt; <a href="../">バージョン 2.2</a> &gt; <a href="./">How-To / チュートリアル</a></div><div id="page-content"><div id="preamble"><h1>ユーザ毎のウェブディレクトリ</h1>
23<div class="toplang">
24<p><span>翻訳済み言語: </span><a href="/en/howto/public_html.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
25<a href="/ja/howto/public_html.html" title="Japanese">&nbsp;ja&nbsp;</a> |
26<a href="/ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
27<a href="/tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
28</div>
29<div class="outofdate">この日本語訳はすでに古くなっている
30            可能性があります。
31            最近更新された内容を見るには英語版をご覧下さい。
32        </div>
33
34<p>複数のユーザのいるシステムでは、<code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブを使って
35    各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが
36    可能です。URL <code>http://example.com/~username/</code> を訪れた人は
37    "<code>username</code>" というユーザの <code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブで指定された
38    サブディレクトリからコンテンツを得ることになります。</p>
39</div>
40<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#related">ユーザ毎のウェブディレクトリ</a></li>
41<li><img alt="" src="/images/down.gif" /> <a href="#userdir">UserDir を使ってファイルのパスを設定する</a></li>
42<li><img alt="" src="/images/down.gif" /> <a href="#enable">この機能を使用できるユーザを制限する</a></li>
43<li><img alt="" src="/images/down.gif" /> <a href="#cgi">ユーザ毎の CGI ディレクトリ</a></li>
44<li><img alt="" src="/images/down.gif" /> <a href="#htaccess">ユーザによる設定変更を許可</a></li>
45</ul><h3>参照</h3><ul class="seealso"><li><a href="/urlmapping.html">URL からファイルシステムへのマッピング</a></li></ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div>
46<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
47<div class="section">
48<h2><a name="related" id="related">ユーザ毎のウェブディレクトリ</a></h2>
49    
50    <table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_userdir.html">mod_userdir</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code></li><li><code class="directive"><a href="/mod/core.html#directorymatch">DirectoryMatch</a></code></li><li><code class="directive"><a href="/mod/core.html#allowoverride">AllowOverride</a></code></li></ul></td></tr></table>
51    </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
52<div class="section">
53<h2><a name="userdir" id="userdir">UserDir を使ってファイルのパスを設定する</a></h2>
54    
55
56    <p><code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブは
57    ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。
58    このディレクティブはいろいろ違った形式を取ることができます。</p>
59
60    <p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ
61    からの相対パスとみなされます。次の設定があったときに:</p>
62
63    <div class="example"><p><code>
64      UserDir public_html
65    </code></p></div>
66
67    <p>URL <code>http://example.com/~rbowen/file.html</code> は
68    パス <code>/home/rbowen/public_html/file.html</code> へ
69    変換されます。</p>
70
71    <p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
72    ユーザ名を加えたものからなります。次の設定のとき:</p>
73
74    <div class="example"><p><code>
75      UserDir /var/html
76    </code></p></div>
77
78    <p>URL <code>http://example.com/~rbowen/file.html</code> は
79    パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
80
81    <p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
82    ユーザ名で置換したものが使用されます。このような設定だと:</p>
83
84    <div class="example"><p><code>
85      UserDir /var/www/*/docs
86    </code></p></div>
87
88    <p>URL <code>http://example.com/~rbowen/file.html</code> は
89    パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
90
91  </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
92<div class="section">
93<h2><a name="enable" id="enable">この機能を使用できるユーザを制限する</a></h2>
94    
95
96    <p>UserDir のドキュメントに示されている構文を使うことで、
97    どのユーザがこの機能を使うことができるかを制限することができます:</p>
98
99    <div class="example"><p><code>
100      UserDir enabled<br />
101      UserDir disabled root jro fish
102    </code></p></div>
103
104    <p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
105    対して UserDir の機能を有効にします。同様にして、以下のように
106    数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
107
108    <div class="example"><p><code>
109      UserDir disabled<br />
110      UserDir enabled rbowen krietz
111    </code></p></div>
112
113    <p>他の例は <code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code>
114    の説明を参照してください。</p>
115
116  </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
117<div class="section">
118<h2><a name="cgi" id="cgi">ユーザ毎の CGI ディレクトリ</a></h2>
119  
120
121   <p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
122    <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code>
123    を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
124    することができます。</p>
125
126    <div class="example"><p><code>
127      &lt;Directory /home/*/public_html/cgi-bin/&gt;<br />
128       Options ExecCGI<br />
129       SetHandler cgi-script<br />
130       &lt;/Directory&gt;
131    </code></p></div>
132
133    <p>そして、<code>UserDir</code> が
134    <code>public_html</code> に設定されていると仮定すると、
135    そのディレクトリの CGI プログラム <code>example.cgi</code>
136    は以下の様に呼び出されることができます:</p>
137
138    <div class="example"><p><code>
139    http://example.com/~rbowen/cgi-bin/example.cgi
140    </code></p></div>
141
142    </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
143<div class="section">
144<h2><a name="htaccess" id="htaccess">ユーザによる設定変更を許可</a></h2>
145    
146
147    <p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
148    ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
149    <code class="directive"><a href="/mod/core.html#allowoverride">AllowOverride</a></code> の値を
150    ユーザが変更することを許可したいディレクティブに対して十分なものに
151    設定していることを確認してください。この機能がどのようにして動作しているか
152    の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで
153    ください。</p>
154
155  </div></div>
156<div class="bottomlang">
157<p><span>翻訳済み言語: </span><a href="/en/howto/public_html.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
158<a href="/ja/howto/public_html.html" title="Japanese">&nbsp;ja&nbsp;</a> |
159<a href="/ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
160<a href="/tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
161</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">コメント</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>
162<script type="text/javascript"><!--//--><![CDATA[//><!--
163var comments_shortname = 'httpd';
164var comments_identifier = 'http://httpd.apache.org/docs/2.2/howto/public_html.html';
165(function(w, d) {
166    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
167        d.write('<div id="comments_thread"><\/div>');
168        var s = d.createElement('script');
169        s.type = 'text/javascript';
170        s.async = true;
171        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
172        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
173    }
174    else { 
175        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
176    }
177})(window, document);
178//--><!]]></script></div><div id="footer">
179<p class="apache">Copyright 2013 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p>
180<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
181if (typeof(prettyPrint) !== 'undefined') {
182    prettyPrint();
183}
184//--><!]]></script>
185</body></html>