1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>ユーザ毎のウェブディレクトリ - Apache HTTP サーバ</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<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" /> 12<script src="/style/scripts/prettify.min.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body id="manual-page"><div id="page-header"> 17<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p> 18<p class="apache">Apache HTTP サーバ バージョン 2.4</p> 19<img alt="" src="/images/feather.gif" /></div> 20<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 21<div id="path"> 22<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://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> 23<div class="toplang"> 24<p><span>翻訳済み言語: </span><a href="/en/howto/public_html.html" hreflang="en" rel="alternate" title="English"> en </a> | 25<a href="/fr/howto/public_html.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 26<a href="/ja/howto/public_html.html" title="Japanese"> ja </a> | 27<a href="/ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 28<a href="/tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 29</div> 30<div class="outofdate">この日本語訳はすでに古くなっている 31 可能性があります。 32 最近更新された内容を見るには英語版をご覧下さい。 33 </div> 34 35<p>複数のユーザのいるシステムでは、<code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブを使って 36 各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが 37 可能です。URL <code>http://example.com/~username/</code> を訪れた人は 38 "<code>username</code>" というユーザの <code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブで指定された 39 サブディレクトリからコンテンツを得ることになります。</p> 40 41 <p>in the default config file, and adapting the <code>httpd-userdir.conf</code> 42 file as necessary, or by including the appropriate directives in a 43 <code>Directory</code> block within the main config file.</p> 44 <p>デフォルトではこれらのディレクトリへのアクセスは<strong>許可されていません</strong>。 45 <code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> を使って有効にできます。 46 有効にするには、デフォルトの設定ファイルで付随する 47 <code>httpd-userdir.conf</code> ファイルが必要で、 48 その中の次の行のコメントアウトを外して有効にするか、 49 </p> 50 <div class="example"><p><code> 51 #Include conf/extra/httpd-userdir.conf 52 </code></p></div> 53 <p>あるいは、メインの設定ファイル中の <code>Directory</code> 54 ブロックの中に適切にディレクティブを記述しておきます。</p> 55</div> 56<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#related">ユーザ毎のウェブディレクトリ</a></li> 57<li><img alt="" src="/images/down.gif" /> <a href="#userdir">UserDir を使ってファイルのパスを設定する</a></li> 58<li><img alt="" src="/images/down.gif" /> <a href="#redirect">外部 URL にリダイレクトする</a></li> 59<li><img alt="" src="/images/down.gif" /> <a href="#enable">この機能を使用できるユーザを制限する</a></li> 60<li><img alt="" src="/images/down.gif" /> <a href="#cgi">ユーザ毎の CGI ディレクトリ</a></li> 61<li><img alt="" src="/images/down.gif" /> <a href="#htaccess">ユーザによる設定変更を許可</a></li> 62</ul><h3>参照</h3><ul class="seealso"><li><a href="/urlmapping.html">URL からファイルシステムへのマッピング</a></li></ul><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 63<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 64<div class="section"> 65<h2><a name="related" id="related">ユーザ毎のウェブディレクトリ</a></h2> 66 67 <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> 68 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 69<div class="section"> 70<h2><a name="userdir" id="userdir">UserDir を使ってファイルのパスを設定する</a></h2> 71 72 73 <p><code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> ディレクティブは 74 ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。 75 このディレクティブはいろいろ違った形式を取ることができます。</p> 76 77 <p>スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ 78 からの相対パスとみなされます。次の設定があったときに:</p> 79 80 <div class="example"><p><code> 81 UserDir public_html 82 </code></p></div> 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 <div class="example"><p><code> 92 UserDir /var/html 93 </code></p></div> 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 <div class="example"><p><code> 102 UserDir /var/www/*/docs 103 </code></p></div> 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 <div class="example"><p><code> 111 UserDir public_html /var/html 112 </code></p></div> 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 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 121<div class="section"> 122<h2><a name="redirect" id="redirect">外部 URL にリダイレクトする</a></h2> 123 124 <p><code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> 125 ディレクティブを使って外部 URL にリダイレクトすることもできます。</p> 126 127 <div class="example"><p><code> 128 UserDir http://example.org/users/*/ 129 </code></p></div> 130 131 <p>上記例では <code>http://example.com/~bob/abc.html</code> 132 へのリクエストは <code>http://example.org/users/bob/abc.html</code> 133 にリダイレクトされます。</p> 134 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 135<div class="section"> 136<h2><a name="enable" id="enable">この機能を使用できるユーザを制限する</a></h2> 137 138 139 <p>UserDir のドキュメントに示されている構文を使うことで、 140 どのユーザがこの機能を使うことができるかを制限することができます:</p> 141 142 <div class="example"><p><code> 143 UserDir enabled<br /> 144 UserDir disabled root jro fish 145 </code></p></div> 146 147 <p>上の設定は <code>dissabled</code> 文のユーザ以外のすべてのユーザに 148 対して UserDir の機能を有効にします。同様にして、以下のように 149 数名のユーザ以外に対してこの機能を無効にすることもできます:</p> 150 151 <div class="example"><p><code> 152 UserDir disabled<br /> 153 UserDir enabled rbowen krietz 154 </code></p></div> 155 156 <p>他の例は <code class="directive"><a href="/mod/mod_userdir.html#userdir">UserDir</a></code> 157 の説明を参照してください。</p> 158 159 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 160<div class="section"> 161<h2><a name="cgi" id="cgi">ユーザ毎の CGI ディレクトリ</a></h2> 162 163 164 <p>それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、 165 <code class="directive"><a href="/mod/core.html#directory"><Directory></a></code> 166 を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に 167 することができます。</p> 168 169 <div class="example"><p><code> 170 <Directory /home/*/public_html/cgi-bin/><br /> 171 Options ExecCGI<br /> 172 SetHandler cgi-script<br /> 173 </Directory> 174 </code></p></div> 175 176 <p>そして、<code>UserDir</code> が 177 <code>public_html</code> に設定されていると仮定すると、 178 そのディレクトリの CGI プログラム <code>example.cgi</code> 179 は以下の様に呼び出されることができます:</p> 180 181 <div class="example"><p><code> 182 http://example.com/~rbowen/cgi-bin/example.cgi 183 </code></p></div> 184 185 </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 186<div class="section"> 187<h2><a name="htaccess" id="htaccess">ユーザによる設定変更を許可</a></h2> 188 189 190 <p>ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、 191 ユーザは <code>.htaccess</code> ファイルを使って設定を変更する必要があります。 192 <code class="directive"><a href="/mod/core.html#allowoverride">AllowOverride</a></code> の値を 193 ユーザが変更することを許可したいディレクティブに対して十分なものに 194 設定していることを確認してください。この機能がどのようにして動作しているか 195 の詳細は <a href="htaccess.html">.htaccess チュートリアル</a> を読んで 196 ください。</p> 197 198 </div></div> 199<div class="bottomlang"> 200<p><span>翻訳済み言語: </span><a href="/en/howto/public_html.html" hreflang="en" rel="alternate" title="English"> en </a> | 201<a href="/fr/howto/public_html.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 202<a href="/ja/howto/public_html.html" title="Japanese"> ja </a> | 203<a href="/ko/howto/public_html.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 204<a href="/tr/howto/public_html.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 205</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 206<script type="text/javascript"><!--//--><![CDATA[//><!-- 207var comments_shortname = 'httpd'; 208var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/public_html.html'; 209(function(w, d) { 210 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 211 d.write('<div id="comments_thread"><\/div>'); 212 var s = d.createElement('script'); 213 s.type = 'text/javascript'; 214 s.async = true; 215 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 216 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 217 } 218 else { 219 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 220 } 221})(window, document); 222//--><!]]></script></div><div id="footer"> 223<p class="apache">Copyright 2014 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 224<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 225if (typeof(prettyPrint) !== 'undefined') { 226 prettyPrint(); 227} 228//--><!]]></script> 229</body></html>