File: /opt/bitnami/apache2/manual/howto/public_html.html.ja.utf8
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="ja"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
<title>ユーザ毎のウェブディレクトリ - Apache HTTP サーバ バージョン 2.4</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet">
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size">
<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">
<script src="../style/scripts/prettify.min.js">
</script>
<link href="../images/favicon.png" rel="shortcut icon"></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/quickreference.html">ディレクティブ</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p>
<p class="apache">Apache HTTP サーバ バージョン 2.4</p>
<img alt="" src="../images/feather.png"></div>
<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif"></a></div>
<div id="path">
<a href="https://www.apache.org/">Apache</a> > <a href="https://httpd.apache.org/">HTTP サーバ</a> > <a href="https://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="../">バージョン 2.4</a> > <a href="./">How-To / チュートリアル</a></div><div id="page-content"><div id="preamble"><h1>ユーザ毎のウェブディレクトリ</h1>
<button aria-label="Toggle language list" class="lang-toggle"><svg xmlns="http://www.w3.org/2000/svg" stroke-width="2" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="16" width="16"><circle r="10" cy="12" cx="12"/><line y2="12" x2="22" y1="12" x1="2"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg></button>
<div class="toplang">
<p><span>翻訳済み言語: </span><a href="../en/howto/public_html.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../es/howto/public_html.html" hreflang="es" rel="alternate" title="Español"> es </a> |
<a href="../fr/howto/public_html.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ja/howto/public_html.html" title="Japanese"> ja </a> |
<a href="../ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
</div>
<div class="outofdate">この日本語訳はすでに古くなっている
可能性があります。
最近更新された内容を見るには英語版をご覧下さい。
</div>
<p>複数のユーザのいるシステムでは、<code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブを使って
各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが
可能です。URL <code>http://example.com/~username/</code> を訪れた人は
"<code>username</code>" というユーザの <code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブで指定された
サブディレクトリからコンテンツを得ることになります。</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>。
<code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code> を使って有効にできます。
有効にするには、デフォルトの設定ファイルで付随する
<code>httpd-userdir.conf</code> ファイルが必要で、
その中の次の行のコメントアウトを外して有効にするか、
</p>
<div class="example"><p><code>
#Include conf/extra/httpd-userdir.conf
</code></p></div>
<p>あるいは、メインの設定ファイル中の <code>Directory</code>
ブロックの中に適切にディレクティブを記述しておきます。</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif"> <a href="#related">ユーザ毎のウェブディレクトリ</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#userdir">UserDir を使ってファイルのパスを設定する</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#redirect">外部 URL にリダイレクトする</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#enable">この機能を使用できるユーザを制限する</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#cgi">ユーザ毎の CGI ディレクトリ</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#htaccess">ユーザによる設定変更を許可</a></li>
</ul><h3>参照</h3><ul class="seealso"><li><a href="../urlmapping.html">URL からファイルシステムへのマッピング</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="related">ユーザ毎のウェブディレクトリ <a title="Permanent link" href="#related" class="permalink">¶</a></h2>
<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>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="userdir">UserDir を使ってファイルのパスを設定する <a title="Permanent link" href="#userdir" class="permalink">¶</a></h2>
<p><code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブは
ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。
このディレクティブはいろいろ違った形式を取ることができます。</p>
<p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ
からの相対パスとみなされます。次の設定があったときに:</p>
<pre class="prettyprint lang-config">UserDir public_html</pre>
<p>URL <code>http://example.com/~rbowen/file.html</code> は
パス <code>/home/rbowen/public_html/file.html</code> へ
変換されます。</p>
<p>パスがスラッシュで始まるときは、ディレクトリパスはそのパスに
ユーザ名を加えたものからなります。次の設定のとき:</p>
<pre class="prettyprint lang-config">UserDir /var/html</pre>
<p>URL <code>http://example.com/~rbowen/file.html</code> は
パス <code>/var/html/rbowen/file.html</code> へ変換されます。</p>
<p>アスタリスク (*) を含むパスが指定されたときは、アスタリスクを
ユーザ名で置換したものが使用されます。このような設定だと:</p>
<pre class="prettyprint lang-config">UserDir /var/www/*/docs</pre>
<p>URL <code>http://example.com/~rbowen/file.html</code> は
パス <code>/var/www/rbowen/docs/file.html</code> へ変換されます。</p>
<p>ディレクトリやディレクトリパスを複数設定することもできます。</p>
<pre class="prettyprint lang-config">UserDir public_html /var/html</pre>
<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>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="redirect">外部 URL にリダイレクトする <a title="Permanent link" href="#redirect" class="permalink">¶</a></h2>
<p><code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code>
ディレクティブを使って外部 URL にリダイレクトすることもできます。</p>
<pre class="prettyprint lang-config">UserDir http://example.org/users/*/</pre>
<p>上記例では <code>http://example.com/~bob/abc.html</code>
へのリクエストは <code>http://example.org/users/bob/abc.html</code>
にリダイレクトされます。</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="enable">この機能を使用できるユーザを制限する <a title="Permanent link" href="#enable" class="permalink">¶</a></h2>
<p>UserDir のドキュメントに示されている構文を使うことで、
どのユーザがこの機能を使うことができるかを制限することができます:</p>
<div class="example"><p><code>
UserDir enabled<br>
UserDir disabled root jro fish
</code></p></div>
<p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに
対して UserDir の機能を有効にします。同様にして、以下のように
数名のユーザ以外に対してこの機能を無効にすることもできます:</p>
<pre class="prettyprint lang-config"> UserDir disabled<br>
UserDir enabled rbowen krietz</pre>
<p>他の例は <code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code>
の説明を参照してください。</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="cgi">ユーザ毎の CGI ディレクトリ <a title="Permanent link" href="#cgi" class="permalink">¶</a></h2>
<p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、
<code class="directive"><a href="../mod/core.html#directory"><Directory></a></code>
を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に
することができます。</p>
<pre class="prettyprint lang-config"><Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory></pre>
<p>そして、<code>UserDir</code> が
<code>public_html</code> に設定されていると仮定すると、
そのディレクトリの CGI プログラム <code>example.cgi</code>
は以下の様に呼び出されることができます:</p>
<div class="example"><p><code>
http://example.com/~rbowen/cgi-bin/example.cgi
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="htaccess">ユーザによる設定変更を許可 <a title="Permanent link" href="#htaccess" class="permalink">¶</a></h2>
<p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、
ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。
<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> の値を
ユーザが変更することを許可したいディレクティブに対して十分なものに
設定していることを確認してください。この機能がどのようにして動作しているか
の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで
ください。</p>
</div></div>
<div class="bottomlang">
<p><span>翻訳済み言語: </span><a href="../en/howto/public_html.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../es/howto/public_html.html" hreflang="es" rel="alternate" title="Español"> es </a> |
<a href="../fr/howto/public_html.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ja/howto/public_html.html" title="Japanese"> ja </a> |
<a href="../ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
</div><div id="footer">
<p class="apache">Copyright 2026 The Apache Software Foundation.<br>この文書は <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p>
<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/quickreference.html">ディレクティブ</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p></div><script><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();
}
var langToggle = document.querySelector('.lang-toggle');
var topLang = document.querySelector('.toplang');
if (langToggle && topLang) {
langToggle.addEventListener('click', function() { topLang.classList.toggle('open'); });
}
var qv = document.getElementById('quickview');
if (qv) {
document.body.appendChild(qv);
var qvBtn = document.createElement('button');
qvBtn.className = 'qv-toggle';
qvBtn.setAttribute('aria-label', 'Toggle page navigation');
qvBtn.innerHTML = '☰';
document.body.appendChild(qvBtn);
qvBtn.addEventListener('click', function() {
var isOpen = qv.classList.toggle('open');
if (isOpen) {
qv.style.top = window.scrollY + 10 + 'px';
}
});
window.addEventListener('scroll', function() { qv.classList.remove('open'); });
}
//--><!]]></script>
</body></html>