]> granicus.if.org Git - apache/blob - docs/manual/howto/public_html.xml.ja
e8a95ee0ce0f41393639e73a3f04f179e9b6c439
[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: 1591191:1741842 (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     <highlight language="config">UserDir public_html</highlight>
81
82     <p>URL <code>http://example.com/~rbowen/file.html</code> は
83     パス <code>/home/rbowen/public_html/file.html</code> へ
84     変換されます。</p>
85
86     <p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
87     ユーザ名を加えたものからなります。次の設定のとき:</p>
88
89     <highlight language="config">UserDir /var/html</highlight>
90
91     <p>URL <code>http://example.com/~rbowen/file.html</code> は
92     パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
93
94     <p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
95     ユーザ名で置換したものが使用されます。このような設定だと:</p>
96
97     <highlight language="config">UserDir /var/www/*/docs</highlight>
98
99     <p>URL <code>http://example.com/~rbowen/file.html</code> は
100     パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
101
102     <p>ディレクトリやディレクトリパスを複数設定することもできます。</p>
103
104     <highlight language="config">UserDir public_html /var/html</highlight>
105
106
107     <p><code>http://example.com/~rbowen/file.html</code> という
108     URL に対しては <code>~rbowen</code> を探します。見つからなければ、
109     <code>/var/html</code> の下にある <code>rbowen</code> を探します。
110     もし見つかれば上記の URL は <code>/var/html/rbowen/file.html</code>
111     というファイルパスに変換されます。</p>
112
113   </section>
114   
115   <section id="redirect">
116     <title>外部 URL にリダイレクトする</title>
117     <p><directive module="mod_userdir">UserDir</directive>
118     ディレクティブを使って外部 URL にリダイレクトすることもできます。</p>
119
120     <highlight language="config">UserDir http://example.org/users/*/</highlight>
121
122     
123     <p>上記例では <code>http://example.com/~bob/abc.html</code>
124     へのリクエストは <code>http://example.org/users/bob/abc.html</code>
125     にリダイレクトされます。</p>
126   </section>
127
128   <section id="enable">
129     <title>この機能を使用できるユーザを制限する</title>
130
131     <p>UserDir のドキュメントに示されている構文を使うことで、
132     どのユーザがこの機能を使うことができるかを制限することができます:</p>
133
134     <example>
135       UserDir enabled<br />
136       UserDir disabled root jro fish
137     </example>
138
139     <p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
140     対して UserDir の機能を有効にします。同様にして、以下のように
141     数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
142
143     <highlight language="config">
144       UserDir disabled<br />
145       UserDir enabled rbowen krietz
146     </highlight>
147
148     <p>他の例は <directive module="mod_userdir">UserDir</directive>
149     の説明を参照してください。</p>
150
151   </section>
152
153   <section id="cgi">
154   <title>ユーザ毎の CGI ディレクトリ</title>
155
156    <p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
157     <directive module="core" type="section">Directory</directive>
158     を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
159     することができます。</p>
160
161     <highlight language="config">
162 &lt;Directory /home/*/public_html/cgi-bin/&gt;
163     Options ExecCGI
164     SetHandler cgi-script
165 &lt;/Directory&gt;
166     </highlight>
167
168     <p>そして、<code>UserDir</code> が
169     <code>public_html</code> に設定されていると仮定すると、
170     そのディレクトリの CGI プログラム <code>example.cgi</code>
171     は以下の様に呼び出されることができます:</p>
172
173     <example>
174     http://example.com/~rbowen/cgi-bin/example.cgi
175     </example>
176
177     </section>
178
179     <section id="htaccess">
180     <title>ユーザによる設定変更を許可</title>
181
182     <p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
183     ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
184     <directive module="core">AllowOverride</directive> の値を
185     ユーザが変更することを許可したいディレクティブに対して十分なものに
186     設定していることを確認してください。この機能がどのようにして動作しているか
187     の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで
188     ください。</p>
189
190   </section>
191
192 </manualpage>