]> granicus.if.org Git - apache/blob - docs/manual/howto/public_html.xml.ja
rebuild docs
[apache] / docs / manual / howto / public_html.xml.ja
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) -->
5
6 <!--
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <manualpage metafile="public_html.xml.meta">
24 <parentdocument href="./">How-To / チュートリアル</parentdocument>
25
26   <title>ユーザ毎のウェブディレクトリ</title>
27
28 <summary>
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>
36
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     その中の次の行のコメントアウトを外して有効にするか、
46     </p>
47     <example>
48       #Include conf/extra/httpd-userdir.conf
49     </example>
50     <p>あるいは、メインの設定ファイル中の <code>Directory</code> 
51     ブロックの中に適切にディレクティブを記述しておきます。</p>
52 </summary>
53
54 <seealso><a href="../urlmapping.html">URL からファイルシステムへのマッピング</a></seealso>
55
56   <section id="related">
57     <title>ユーザ毎のウェブディレクトリ</title>
58     <related>
59       <modulelist>
60         <module>mod_userdir</module>
61       </modulelist>
62       <directivelist>
63         <directive module="mod_userdir">UserDir</directive>
64         <directive module="core">DirectoryMatch</directive>
65         <directive module="core">AllowOverride</directive>
66       </directivelist>
67     </related>
68     </section>
69
70     <section id="userdir">
71     <title>UserDir を使ってファイルのパスを設定する</title>
72
73     <p><directive module="mod_userdir">UserDir</directive> ディレクティブは
74     ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。
75     このディレクティブはいろいろ違った形式を取ることができます。</p>
76
77     <p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ
78     からの相対パスとみなされます。次の設定があったときに:</p>
79
80     <example>
81       UserDir public_html
82     </example>
83
84     <p>URL <code>http://example.com/~rbowen/file.html</code> は
85     パス <code>/home/rbowen/public_html/file.html</code> へ
86     変換されます。</p>
87
88     <p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
89     ユーザ名を加えたものからなります。次の設定のとき:</p>
90
91     <example>
92       UserDir /var/html
93     </example>
94
95     <p>URL <code>http://example.com/~rbowen/file.html</code> は
96     パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
97
98     <p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
99     ユーザ名で置換したものが使用されます。このような設定だと:</p>
100
101     <example>
102       UserDir /var/www/*/docs
103     </example>
104
105     <p>URL <code>http://example.com/~rbowen/file.html</code> は
106     パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
107
108     <p>ディレクトリやディレクトリパスを複数設定することもできます。</p>
109
110     <example>
111       UserDir public_html /var/html
112     </example>
113
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>
119
120   </section>
121   
122   <section id="redirect">
123     <title>外部 URL にリダイレクトする</title>
124     <p><directive module="mod_userdir">UserDir</directive>
125     ディレクティブを使って外部 URL にリダイレクトすることもできます。</p>
126     
127     <example>
128       UserDir http://example.org/users/*/
129     </example>
130     
131     <p>上記例では <code>http://example.com/~bob/abc.html</code>
132     へのリクエストは <code>http://example.org/users/bob/abc.html</code>
133     にリダイレクトされます。</p>
134   </section>
135
136   <section id="enable">
137     <title>この機能を使用できるユーザを制限する</title>
138
139     <p>UserDir のドキュメントに示されている構文を使うことで、
140     どのユーザがこの機能を使うことができるかを制限することができます:</p>
141
142     <example>
143       UserDir enabled<br />
144       UserDir disabled root jro fish
145     </example>
146
147     <p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
148     対して UserDir の機能を有効にします。同様にして、以下のように
149     数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
150
151     <example>
152       UserDir disabled<br />
153       UserDir enabled rbowen krietz
154     </example>
155
156     <p>他の例は <directive module="mod_userdir">UserDir</directive>
157     の説明を参照してください。</p>
158
159   </section>
160
161   <section id="cgi">
162   <title>ユーザ毎の CGI ディレクトリ</title>
163
164    <p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
165     <directive module="core" type="section">Directory</directive>
166     を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
167     することができます。</p>
168
169     <example>
170       &lt;Directory /home/*/public_html/cgi-bin/&gt;<br />
171        Options ExecCGI<br />
172        SetHandler cgi-script<br />
173        &lt;/Directory&gt;
174     </example>
175
176     <p>そして、<code>UserDir</code> が
177     <code>public_html</code> に設定されていると仮定すると、
178     そのディレクトリの CGI プログラム <code>example.cgi</code>
179     は以下の様に呼び出されることができます:</p>
180
181     <example>
182     http://example.com/~rbowen/cgi-bin/example.cgi
183     </example>
184
185     </section>
186
187     <section id="htaccess">
188     <title>ユーザによる設定変更を許可</title>
189
190     <p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
191     ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
192     <directive module="core">AllowOverride</directive> の値を
193     ユーザが変更することを許可したいディレクティブに対して十分なものに
194     設定していることを確認してください。この機能がどのようにして動作しているか
195     の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで
196     ください。</p>
197
198   </section>
199
200 </manualpage>