mirror of
https://github.com/apache/httpd.git
synced 2025-05-28 13:41:30 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1330844 13f79535-47bb-0310-9956-ffa450edef68
201 lines
8.3 KiB
XML
201 lines
8.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
|
|
<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
|
|
<!-- English Revision: 659902:1330277 (outdated) -->
|
|
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
this work for additional information regarding copyright ownership.
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
(the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<manualpage metafile="public_html.xml.meta">
|
|
<parentdocument href="./">How-To / チュートリアル</parentdocument>
|
|
|
|
<title>ユーザ毎のウェブディレクトリ</title>
|
|
|
|
<summary>
|
|
<p>複数のユーザのいるシステムでは、<directive
|
|
module="mod_userdir">UserDir</directive> ディレクティブを使って
|
|
各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが
|
|
可能です。URL <code>http://example.com/~username/</code> を訪れた人は
|
|
"<code>username</code>" というユーザの <directive
|
|
module="mod_userdir">UserDir</directive> ディレクティブで指定された
|
|
サブディレクトリからコンテンツを得ることになります。</p>
|
|
|
|
<p>in the default config file, and adapting the <code
|
|
>httpd-userdir.conf</code>
|
|
file as necessary, or by including the appropriate directives in a
|
|
<code>Directory</code> block within the main config file.</p>
|
|
<p>デフォルトではこれらのディレクトリへのアクセスは<strong>許可されていません</strong>。
|
|
<directive module="mod_userdir">UserDir</directive> を使って有効にできます。
|
|
有効にするには、デフォルトの設定ファイルで付随する
|
|
<code>httpd-userdir.conf</code> ファイルが必要で、
|
|
その中の次の行のコメントアウトを外して有効にするか、
|
|
</p>
|
|
<example>
|
|
#Include conf/extra/httpd-userdir.conf
|
|
</example>
|
|
<p>あるいは、メインの設定ファイル中の <code>Directory</code>
|
|
ブロックの中に適切にディレクティブを記述しておきます。</p>
|
|
</summary>
|
|
|
|
<seealso><a href="../urlmapping.html">URL からファイルシステムへのマッピング</a></seealso>
|
|
|
|
<section id="related">
|
|
<title>ユーザ毎のウェブディレクトリ</title>
|
|
<related>
|
|
<modulelist>
|
|
<module>mod_userdir</module>
|
|
</modulelist>
|
|
<directivelist>
|
|
<directive module="mod_userdir">UserDir</directive>
|
|
<directive module="core">DirectoryMatch</directive>
|
|
<directive module="core">AllowOverride</directive>
|
|
</directivelist>
|
|
</related>
|
|
</section>
|
|
|
|
<section id="userdir">
|
|
<title>UserDir を使ってファイルのパスを設定する</title>
|
|
|
|
<p><directive module="mod_userdir">UserDir</directive> ディレクティブは
|
|
ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。
|
|
このディレクティブはいろいろ違った形式を取ることができます。</p>
|
|
|
|
<p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ
|
|
からの相対パスとみなされます。次の設定があったときに:</p>
|
|
|
|
<example>
|
|
UserDir public_html
|
|
</example>
|
|
|
|
<p>URL <code>http://example.com/~rbowen/file.html</code> は
|
|
パス <code>/home/rbowen/public_html/file.html</code> へ
|
|
変換されます。</p>
|
|
|
|
<p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
|
|
ユーザ名を加えたものからなります。次の設定のとき:</p>
|
|
|
|
<example>
|
|
UserDir /var/html
|
|
</example>
|
|
|
|
<p>URL <code>http://example.com/~rbowen/file.html</code> は
|
|
パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
|
|
|
|
<p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
|
|
ユーザ名で置換したものが使用されます。このような設定だと:</p>
|
|
|
|
<example>
|
|
UserDir /var/www/*/docs
|
|
</example>
|
|
|
|
<p>URL <code>http://example.com/~rbowen/file.html</code> は
|
|
パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
|
|
|
|
<p>ディレクトリやディレクトリパスを複数設定することもできます。</p>
|
|
|
|
<example>
|
|
UserDir public_html /var/html
|
|
</example>
|
|
|
|
<p><code>http://example.com/~rbowen/file.html</code> という
|
|
URL に対しては <code>~rbowen</code> を探します。見つからなければ、
|
|
<code>/var/html</code> の下にある <code>rbowen</code> を探します。
|
|
もし見つかれば上記の URL は <code>/var/html/rbowen/file.html</code>
|
|
というファイルパスに変換されます。</p>
|
|
|
|
</section>
|
|
|
|
<section id="redirect">
|
|
<title>外部 URL にリダイレクトする</title>
|
|
<p><directive module="mod_userdir">UserDir</directive>
|
|
ディレクティブを使って外部 URL にリダイレクトすることもできます。</p>
|
|
|
|
<example>
|
|
UserDir http://example.org/users/*/
|
|
</example>
|
|
|
|
<p>上記例では <code>http://example.com/~bob/abc.html</code>
|
|
へのリクエストは <code>http://example.org/users/bob/abc.html</code>
|
|
にリダイレクトされます。</p>
|
|
</section>
|
|
|
|
<section id="enable">
|
|
<title>この機能を使用できるユーザを制限する</title>
|
|
|
|
<p>UserDir のドキュメントに示されている構文を使うことで、
|
|
どのユーザがこの機能を使うことができるかを制限することができます:</p>
|
|
|
|
<example>
|
|
UserDir enabled<br />
|
|
UserDir disabled root jro fish
|
|
</example>
|
|
|
|
<p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
|
|
対して UserDir の機能を有効にします。同様にして、以下のように
|
|
数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
|
|
|
|
<example>
|
|
UserDir disabled<br />
|
|
UserDir enabled rbowen krietz
|
|
</example>
|
|
|
|
<p>他の例は <directive module="mod_userdir">UserDir</directive>
|
|
の説明を参照してください。</p>
|
|
|
|
</section>
|
|
|
|
<section id="cgi">
|
|
<title>ユーザ毎の CGI ディレクトリ</title>
|
|
|
|
<p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
|
|
<directive module="core" type="section">Directory</directive>
|
|
を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
|
|
することができます。</p>
|
|
|
|
<example>
|
|
<Directory /home/*/public_html/cgi-bin/><br />
|
|
Options ExecCGI<br />
|
|
SetHandler cgi-script<br />
|
|
</Directory>
|
|
</example>
|
|
|
|
<p>そして、<code>UserDir</code> が
|
|
<code>public_html</code> に設定されていると仮定すると、
|
|
そのディレクトリの CGI プログラム <code>example.cgi</code>
|
|
は以下の様に呼び出されることができます:</p>
|
|
|
|
<example>
|
|
http://example.com/~rbowen/cgi-bin/example.cgi
|
|
</example>
|
|
|
|
</section>
|
|
|
|
<section id="htaccess">
|
|
<title>ユーザによる設定変更を許可</title>
|
|
|
|
<p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
|
|
ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
|
|
<directive module="core">AllowOverride</directive> の値を
|
|
ユーザが変更することを許可したいディレクティブに対して十分なものに
|
|
設定していることを確認してください。この機能がどのようにして動作しているか
|
|
の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで
|
|
ください。</p>
|
|
|
|
</section>
|
|
|
|
</manualpage>
|