1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
4 <!-- English Revision: 659902:1591191 (outdated) -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <manualpage metafile="public_html.xml.meta">
24 <parentdocument href="./">How-To / チュートリアル</parentdocument>
26 <title>ユーザ毎のウェブディレクトリ</title>
29 <p>複数のユーザのいるシステムでは、<directive
30 module="mod_userdir">UserDir</directive> ディレクティブを使って
31 各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが
32 可能です。URL <code>http://example.com/~username/</code> を訪れた人は
33 "<code>username</code>" というユーザの <directive
34 module="mod_userdir">UserDir</directive> ディレクティブで指定された
35 サブディレクトリからコンテンツを得ることになります。</p>
37 <p>in the default config file, and adapting the <code
38 >httpd-userdir.conf</code>
39 file as necessary, or by including the appropriate directives in a
40 <code>Directory</code> block within the main config file.</p>
41 <p>デフォルトではこれらのディレクトリへのアクセスは<strong>許可されていません</strong>。
42 <directive module="mod_userdir">UserDir</directive> を使って有効にできます。
43 有効にするには、デフォルトの設定ファイルで付随する
44 <code>httpd-userdir.conf</code> ファイルが必要で、
45 その中の次の行のコメントアウトを外して有効にするか、
48 #Include conf/extra/httpd-userdir.conf
50 <p>あるいは、メインの設定ファイル中の <code>Directory</code>
51 ブロックの中に適切にディレクティブを記述しておきます。</p>
54 <seealso><a href="../urlmapping.html">URL からファイルシステムへのマッピング</a></seealso>
56 <section id="related">
57 <title>ユーザ毎のウェブディレクトリ</title>
60 <module>mod_userdir</module>
63 <directive module="mod_userdir">UserDir</directive>
64 <directive module="core">DirectoryMatch</directive>
65 <directive module="core">AllowOverride</directive>
70 <section id="userdir">
71 <title>UserDir を使ってファイルのパスを設定する</title>
73 <p><directive module="mod_userdir">UserDir</directive> ディレクティブは
74 ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。
75 このディレクティブはいろいろ違った形式を取ることができます。</p>
77 <p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ
78 からの相対パスとみなされます。次の設定があったときに:</p>
84 <p>URL <code>http://example.com/~rbowen/file.html</code> は
85 パス <code>/home/rbowen/public_html/file.html</code> へ
88 <p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
89 ユーザ名を加えたものからなります。次の設定のとき:</p>
95 <p>URL <code>http://example.com/~rbowen/file.html</code> は
96 パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
98 <p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
99 ユーザ名で置換したものが使用されます。このような設定だと:</p>
102 UserDir /var/www/*/docs
105 <p>URL <code>http://example.com/~rbowen/file.html</code> は
106 パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
108 <p>ディレクトリやディレクトリパスを複数設定することもできます。</p>
111 UserDir public_html /var/html
114 <p><code>http://example.com/~rbowen/file.html</code> という
115 URL に対しては <code>~rbowen</code> を探します。見つからなければ、
116 <code>/var/html</code> の下にある <code>rbowen</code> を探します。
117 もし見つかれば上記の URL は <code>/var/html/rbowen/file.html</code>
118 というファイルパスに変換されます。</p>
122 <section id="redirect">
123 <title>外部 URL にリダイレクトする</title>
124 <p><directive module="mod_userdir">UserDir</directive>
125 ディレクティブを使って外部 URL にリダイレクトすることもできます。</p>
128 UserDir http://example.org/users/*/
131 <p>上記例では <code>http://example.com/~bob/abc.html</code>
132 へのリクエストは <code>http://example.org/users/bob/abc.html</code>
136 <section id="enable">
137 <title>この機能を使用できるユーザを制限する</title>
139 <p>UserDir のドキュメントに示されている構文を使うことで、
140 どのユーザがこの機能を使うことができるかを制限することができます:</p>
143 UserDir enabled<br />
144 UserDir disabled root jro fish
147 <p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
148 対して UserDir の機能を有効にします。同様にして、以下のように
149 数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
152 UserDir disabled<br />
153 UserDir enabled rbowen krietz
156 <p>他の例は <directive module="mod_userdir">UserDir</directive>
162 <title>ユーザ毎の CGI ディレクトリ</title>
164 <p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
165 <directive module="core" type="section">Directory</directive>
166 を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
170 <Directory /home/*/public_html/cgi-bin/><br />
171 Options ExecCGI<br />
172 SetHandler cgi-script<br />
176 <p>そして、<code>UserDir</code> が
177 <code>public_html</code> に設定されていると仮定すると、
178 そのディレクトリの CGI プログラム <code>example.cgi</code>
179 は以下の様に呼び出されることができます:</p>
182 http://example.com/~rbowen/cgi-bin/example.cgi
187 <section id="htaccess">
188 <title>ユーザによる設定変更を許可</title>
190 <p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
191 ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
192 <directive module="core">AllowOverride</directive> の値を
193 ユーザが変更することを許可したいディレクティブに対して十分なものに
194 設定していることを確認してください。この機能がどのようにして動作しているか
195 の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで