env.html.ja.utf8 revision b036ef2952fb6924b308f954b39786443460ddc6
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<?xml version="1.0" encoding="UTF-8"?>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head><!--
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington This file is generated from xml source: DO NOT EDIT
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington -->
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<title>Apache の環境変数 - Apache HTTP サーバ</title>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<link href="/images/favicon.ico" rel="shortcut icon" /></head>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<body id="manual-page"><div id="page-header">
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<p class="apache">Apache HTTP サーバ バージョン 2.3</p>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<img alt="" src="/images/feather.gif" /></div>
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
0eace215bd758e347767c63c13504520e855b94aAndreas Gustafsson<div id="path">
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP サーバ</a> &gt; <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> &gt; <a href="./">バージョン
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 2.3</a></div><div id="page-content"><div id="preamble"><h1>Apache の環境変数</h1>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="toplang">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<p><span>言語: </span><a href="/en/env.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<a href="/ja/env.html" title="Japanese">&nbsp;ja&nbsp;</a> |
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<a href="/ko/env.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence<a href="/tr/env.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence</div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="outofdate">この日本語訳はすでに古くなっている可能性があります。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence 更新された内容を見るには英語版をご覧下さい。</div>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence <p>Apache HTTP サーバは<em>環境変数</em>と呼ばれる、名前のついた
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 変数に情報を記憶する仕組みを提供しています。この情報はログ収集や
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence アクセス制御などのいろいろな操作を制御するために使うことができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington これらの変数は CGI スクリプトなどの外部プログラムと通信するためにも
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 使われます。この文書はそれらの変数の操作方法と使用方法をいくつか
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 紹介します。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>これらの変数は<em>環境変数</em>と呼ばれていますが、オペレーティング
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington システムによって制御されている環境変数と同じではありません。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 実際は、これらの変数は Apache の内部構造の中に記憶され、操作されています。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington それらは、CGI や SSI スクリプトに渡されたときだけ、実際の
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington オペレーティングシステムの環境変数になります。サーバ自身が
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 実行されているオペレーティングシステムの環境を操作したい場合は、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington オペレーティングシステムのシェルが提供している標準の環境変数の
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 操作方法を使わなければなりません。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#setting">環境変数の設定</a></li>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<li><img alt="" src="/images/down.gif" /> <a href="#using">環境変数の使用</a></li>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence<li><img alt="" src="/images/down.gif" /> <a href="#special">特別な目的の環境変数</a></li>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<li><img alt="" src="/images/down.gif" /> <a href="#examples">例</a></li>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington</ul></div>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence<div class="section">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<h2><a name="setting" id="setting">環境変数の設定</a></h2>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_env.html">mod_env</a></code></li><li><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></li><li><code class="module"><a href="/mod/mod_setenvif.html">mod_setenvif</a></code></li><li><code class="module"><a href="/mod/mod_unique_id.html">mod_unique_id</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_setenvif.html#browsermatch">BrowserMatch</a></code></li><li><code class="directive"><a href="/mod/mod_setenvif.html#browsermatchnocase">BrowserMatchNoCase</a></code></li><li><code class="directive"><a href="/mod/mod_env.html#passenv">PassEnv</a></code></li><li><code class="directive"><a href="/mod/mod_rewrite.html#rewriterule">RewriteRule</a></code></li><li><code class="directive"><a href="/mod/mod_env.html#setenv">SetEnv</a></code></li><li><code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code></li><li><code class="directive"><a href="/mod/mod_setenvif.html#setenvifnocase">SetEnvIfNoCase</a></code></li><li><code class="directive"><a href="/mod/mod_env.html#unsetenv">UnsetEnv</a></code></li></ul></td></tr></table>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="basic-manipulation" id="basic-manipulation">基本的な環境の操作</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>Apache において環境変数を設定する一番基本的な方法は、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 無条件に環境変数を設定する <code class="directive"><a href="/mod/mod_env.html#setenv">SetEnv</a></code> ディレクティブを使用することです。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_env.html#passenv">PassEnv</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブにより、Apache が起動されたシェルの
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 環境変数を渡すこともできます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="conditional" id="conditional">リクエスト毎に条件に基づいて設定する</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>より柔軟性を高めるために、mod_setenvif
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington で提供されているディレクティブを使用することで、リクエストの
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 特性に基づいて環境変数を設定することができます。例えば、特定のブラウザ
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington (User-Agent) のリクエストや特定の Referer [意図的な綴りです]
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <span class="transnote">(<em>訳注:</em> 正しい綴りは referrer ですが、HTTP の仕様では Referer
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington となっています)</span>ヘッダが見つかったときのみ変数を設定することができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington mod_rewrite の <code class="directive"><a href="/mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブにおいて環境変数を設定する <code>[E=...]</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington オプションを使用することで、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington より柔軟な設定を行なうことができます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="unique-identifiers" id="unique-identifiers">一意な識別子</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>mod_unique_id は、非常に限られた条件の下で
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 「すべて」のリクエストについて、一意であることが保証されている値を環境変数
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code>UNIQUE_ID</code> に設定します。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson <h3><a name="standard-cgi" id="standard-cgi">標準 CGI 変数</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>Apache の設定ファイルで設定された環境変数とシェルから渡される
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 環境変数に加えて、CGI スクリプトと SSI ページには <a href="http://cgi-spec.golux.com">CGI の仕様</a>で要求されている、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington リクエストのメタ情報を持った環境変数の組が提供されます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="caveats" id="caveats">いくつかの注意</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <ul>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <li>環境を操作するディレクティブを使って標準 CGI
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence 変数を上書きしたり変更したりすることはできません。</li>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence <li>CGI スクリプトを起動するために <code class="program"><a href="/programs/suexec.html">suexec</a></code>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence が使用されている場合、CGI スクリプトが起動するために、環境変数は<em>安全</em>な環境変数の組に整理されます。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence この安全な環境変数の集合は、コンパイル時に <code>suexec.c</code>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence で定義されます。</li>
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence <li>移植性のために、環境変数の名前はアルファベット、
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence 数字とアンダースコア <span class="transnote">(<em>訳注:</em> '_')</span> だけから成ります。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence さらに、最初の文字は数字であってはいけません。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence この制限に合わない文字は CGI スクリプトと SSI
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson ページに渡されるときにアンダースコアに置換されます。</li>
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson <li><code class="directive"><a href="/mod/mod_env.html#setenv">SetEnv</a></code> はリクエスト処理の
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson 段階の中でも遅くに実行されます。つまり
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code> や
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington などからは、変数がそこで設定されていることがわかりません。</li>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </ul>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="section">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<h2><a name="using" id="using">環境変数の使用</a></h2>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_authz_host.html">mod_authz_host</a></code></li><li><code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="/mod/mod_ext_filter.html">mod_ext_filter</a></code></li><li><code class="module"><a href="/mod/mod_headers.html">mod_headers</a></code></li><li><code class="module"><a href="/mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code></li><li><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_authz_host.html#allow">Allow</a></code></li><li><code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code></li><li><code class="directive"><a href="/mod/mod_authz_host.html#deny">Deny</a></code></li><li><code class="directive"><a href="/mod/mod_ext_filter.html#extfilterdefine">ExtFilterDefine</a></code></li><li><code class="directive"><a href="/mod/mod_headers.html#header">Header</a></code></li><li><code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code></li><li><code class="directive"><a href="/mod/mod_rewrite.html#rewritecond">RewriteCond</a></code></li><li><code class="directive"><a href="/mod/mod_rewrite.html#rewriterule">RewriteRule</a></code></li></ul></td></tr></table>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="cgi-scripts" id="cgi-scripts">CGI スクリプト</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>環境変数の主な利用法の一つは、CGI スクリプトに情報を伝えることです。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 上で説明されているように、CGI スクリプトに渡される環境変数は Apache
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington の設定により設定される変数に加えて、リクエストの標準のメタ情報を含んでいます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 詳細は <a href="howto/cgi.html">CGI チュートリアル</a>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington を参照してください。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="ssi-pages" id="ssi-pages">SSI ページ</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>mod_include の <code>INCLUDES</code> フィルタで処理される
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington server-parsed (SSI) ドキュメントでは、<code>echo</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 要素を使用すると環境変数が出力されます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington また、ページのある部分がリクエストの性質に応じて変更されるように、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 環境変数をフロー制御要素で使うことができます。詳細は
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <a href="howto/ssi.html">SSI チュートリアル</a> を参照してください。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="access-control" id="access-control">アクセス制御</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code>allow from env=</code> ディレクティブと <code>deny from env=</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブを使用して、サーバへのアクセスを環境変数の値で制御することができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブと組み合わせることで、クライアントの特性に基づいて
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington サーバへのアクセス制御を柔軟に行なうことができるようになります。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington たとえば、これらのディレクティブを使用して、特定のブラウザ (User-Agent)
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington からのアクセスを拒否することができます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="logging" id="logging">条件付きログ記録</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブのオプション <code>%e</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington を使用することで、環境変数をアクセスログに記録することができます。さらに、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブの条件分岐式を使用することで、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 環境変数の値によってリクエストをログに記録するかどうかを決めることができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブと組み合わせることで、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington どのリクエストをログに記録するかを柔軟に制御することが可能になります。たとえば、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code>gif</code> で終わるファイル名へのリクエストはログに記録しない、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 違うサブネットのクライアントからのリクエストだけをログに記録する、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington という選択が可能です。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="response-headers" id="response-headers">条件付き応答ヘッダ</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code class="directive"><a href="/mod/mod_headers.html#header">Header</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブは環境変数の存在や不在によってクライアントへの応答に特定の
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington HTTP ヘッダを付けるかどうかを決めることができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington これにより、たとえば、クライアントからのリクエスト
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington にあるヘッダがある場合にのみ特定の応答ヘッダを送る、というようなことが
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington できます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="external-filter" id="external-filter">外部フィルタの適用</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code class="directive"><a href="/mod/mod_ext_filter.html#extfilterdefine">ExtFilterDefine</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブを使用して
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="module"><a href="/mod/mod_ext_filter.html">mod_ext_filter</a></code> で設定される外部フィルタは、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code>disableenv=</code> と <code>enableenv=</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington オプションを使って、環境変数による条件付き適用ができます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="url-rewriting" id="url-rewriting">URL の書き換え</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code class="directive"><a href="/mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブで<em>評価文字列</em>として
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code>%{ENV:...}</code> 式を指定することで、mod_rewrite
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington の書き換えエンジンが環境変数に基いて条件分岐を行なうことができます。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence mod_rewrite が使用可能な変数で <code>ENV:</code> が前についていない変数は、
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence 実際は環境変数ではないということに注意してください。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence それらは他のモジュールからは使用できない mod_rewrite 用の特別な変数です。
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrence </p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="section">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<h2><a name="special" id="special">特別な目的の環境変数</a></h2>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>互換性の問題を解決するために、特定のクライアントと通信しているときは
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington Apache の動作を変更できる機構が導入されました。できるだけ柔軟にするために、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington これらの機構は環境変数を定義することで呼び出されます。普通は、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="directive"><a href="/mod/mod_setenvif.html#browsermatch">BrowserMatch</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ディレクティブを使いますが、たとえば <code class="directive"><a href="/mod/mod_env.html#setenv">SetEnv</a></code> ディレクティブや <code class="directive"><a href="/mod/mod_env.html#passenv">PassEnv</a></code> ディレクティブも使用することができます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="downgrade" id="downgrade">downgrade-1.0</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>これを指定することで、リクエストが HTTP/1.0
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington より新しいプロトコルの場合でも、HTTP/1.0 として扱われます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="force-gzip" id="force-gzip">force-gzip</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code>DEFLATE</code> フィルタが使用するように設定されているときに、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington この環境変数はブラウザの accept-encoding の設定を無視して常に
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 圧縮された出力を送るようにします。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="force-no-vary" id="force-no-vary">force-no-vary</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>応答ヘッダがクライアントに送られる前に <code>Vary</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington フィールドを取り除きます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington クライアントの中にはこのフィールドを正しく解釈しないものがあります。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington この変数を設定することでその問題を回避することができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington この変数を設定すると、<strong>force-response-1.0</strong>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington が設定されたことになります。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="force-response" id="force-response">force-response-1.0</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>これが設定されていると、HTTP/1.0 リクエストを発行するクライアントに対しては
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 常に HTTP/1.0 で応答するようになります。この機能は、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 元々は AOL のプロキシの問題のために実装されました。HTTP/1.0 クライアントの中には、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington HTTP/1.1 の応答を返されると正しく動作しないものがあるかもしれません。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington この機能を使用することで、そのようなクライアントとの間の互換性問題を解決できます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="gzip-only-text-html" id="gzip-only-text-html">gzip-only-text/html</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>これが 1 に設定されると、この変数は <code>text/html</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 以外のコンテントタイプに対する、<code class="module"><a href="/mod/mod_deflate.html">mod_deflate</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 提供の <code>DEFLATE</code> 出力フィルタを無効にします。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington また、静的に、既に圧縮されたファイルを使用したい場合、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington (gzip だけでなく、"identity" と異なる全てのエンコードに対して)
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code> も変数を評価します。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="no-gzip" id="no-gzip">no-gzip</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>セットされると、<code class="module"><a href="/mod/mod_deflate.html">mod_deflate</a></code> の
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington <code>DEFLATE</code> フィルタがオフになります。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington そして <code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington はエンコードされたリソースを送らないようにします。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="nokeepalive" id="nokeepalive">nokeepalive</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>これが設定されている場合は、<code class="directive"><a href="/mod/core.html#keepalive">KeepAlive</a></code> を使用しないようにします。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h4><a name="prefer-language" id="prefer-language">prefer-language</a></h4>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code> の挙動に影響を与えます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington (<code>en</code>, <code>ja</code>, <code>x-klingon</code>といった)
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 言語タグが格納されていれば、その言語の variant を送信しようとします。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington そのような variant がない場合は、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 通常の<a href="content-negotiation.html">ネゴシエーション</a>処理が
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 適用されます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington <h3><a name="redirect-carefully" id="redirect-carefully">redirect-carefully</a></h3>
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington <p>これはクライアントへのリダイレクトの送信をサーバがより注意深く
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington 行なうようにします。
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington これは通常、リダイレクトに際してクライアントに
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington 問題があることが分かっている場合に使われます。この機能は元々は
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington マイクロソフトのウェブフォルダのソフトが DAV
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington メソッドによるディレクトリのリソースへのリダイレクトの扱いに
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 問題がり、それを回避するために実装されました。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="suppress-error-charset" id="suppress-error-charset">suppress-error-charset</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p><em>Apache 2.2 以降で利用可能</em></p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>クライアントのリクエストに対する応答としてリダイレクトを送信する際、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington レスポンスにはリダイレクトが自動的に行なえない (行なわれない)
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 場合に表示するテキストが含まれます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 通常、このテキストに合致したキャラクタセット、ISO-8859-1
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington でラベル付けをします。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>しかし、リダイレクト先が別の文字セットを使っている場合、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ある問題のあるブラウザのバージョンでは、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington リダイレクト先の実際の文字セットの代わりに、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington リダイレクト元の文字セットを使ってしまうことがあります。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington その結果、例えば変な描画が行なわれたりして、読めなくなったりします。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>この環境変数を設定することで、リダイレクションテキストに対する
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington キャラクタセットの指定を除去しますので、それら問題のあるブラウザでも
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington リダイレクト先の文字セットを正しく使うようにできます。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <div class="warning">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3>セキュリティ</h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>文字セットを指定せずにエラーページを送信すると、
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington クロスサイトスクリプティング <span class="transnote">(<em>訳注:</em> XSS)</span>
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington 攻撃の危険性がでてきます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington HTTP/1.1 仕様に準拠していなくて、コンテンツの中身から文字セットを
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington "推測" しようとするブラウザ (MSIE) が実際にあるからです。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington そのようなブラウザは UTF-7 文字セットを使って簡単に騙すことができます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington クロスサイトスクリプティング攻撃を防ぐために実装されている
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 通常のエスケープ機構が、入力データ中にある UTF-7 で
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington エンコードされたコンテンツ (リクエスト URI など) には
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington うまく動作しないからです。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </div>
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley <h3><a name="proxy" id="proxy">force-proxy-request-1.0, proxy-nokeepalive, proxy-sendchunked, proxy-sendcl</a></h3>
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley <p>これらの指示子は <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> の挙動を変更します。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 詳細は <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> のドキュメントをご参照ください。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington
091329e690b20755aa80b86cc7389d25c5d32c9bBrian Wellington </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="section">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<h2><a name="examples" id="examples">例</a></h2>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="misbehaving" id="misbehaving">おかしな挙動をするクライアントに対してプロトコルの動作を変更する</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>クライアントに関する既知の問題に対処するために、以下の行を
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington httpd.conf に入れることを推奨しています。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>古いバージョンの Apache では、クライアントの問題に対応するために
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington httpd.conf に次の行を加えるよう推奨されていましたが、
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 今となっては、問題としていたクライアントは実際には見かけることは
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington なくなってきたので、この設定はもはや必要ないかもしれません。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="example"><pre>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington#
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# The following directives modify normal HTTP response behavior.
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# The first directive disables keepalive for Netscape 2.x and browsers that
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# spoof it. There are known problems with these browser implementations.
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# The second directive is for Microsoft Internet Explorer 4.0b2
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington# which has a broken HTTP/1.1 implementation and does not properly
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington# support keepalive when it is used on 301 or 302 (redirect) responses.
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington#
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonBrowserMatch "Mozilla/2" nokeepalive
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonBrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington#
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# The following directive disables HTTP/1.1 responses to browsers which
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# are in violation of the HTTP/1.0 spec by not being able to grok a
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# basic 1.1 response.
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington#
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonBrowserMatch "RealPlayer 4\.0" force-response-1.0
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonBrowserMatch "Java/1\.0" force-response-1.0
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonBrowserMatch "JDK/1\.0" force-response-1.0</pre></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="no-img-log" id="no-img-log">画像へのリクエストをアクセスログに記録しない</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington <p>この例では、画像へのリクエストがアクセスログに現れないようにします。
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington これを変更することで、特定のディレクトリのログ収集をやめたり、
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington 特定のホストからのリクエストのログ収集をやめたりすることが簡単にできます。
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington </p>
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington <div class="example"><pre>
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian WellingtonSetEnvIf Request_URI \.gif image-request
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian WellingtonSetEnvIf Request_URI \.jpg image-request
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian WellingtonSetEnvIf Request_URI \.png image-request
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian WellingtonCustomLog logs/access_log common env=!image-request</pre></div>
e4cd5a1e5d0358abeee7618b02b4592c055d957fBrian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <h3><a name="image-theft" id="image-theft">「画像の盗用」を防ぐ</a></h3>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>この例は、別のサーバにいる人が、あなたのサーバにある画像を
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington inline 画像として使用することを防ぎます。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington これは推奨されている設定ではありませんが、ある限定された状況では有効です。
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington ここでは、すべての画像は <code>/web/images</code>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington というディレクトリにあると仮定します。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <div class="example"><pre>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonSetEnvIf Referer "^http://www\.example\.com/" local_referal
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# Allow browsers that do not send Referer info
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian WellingtonSetEnvIf Referer "^$" local_referal
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington&lt;Directory /web/images&gt;
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington Order Deny,Allow
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington Deny from all
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley Allow from env=local_referal
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley&lt;/Directory&gt;</pre></div>
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington <p>この手法に関する詳しい情報は ServerWatch にあるチュートリアル
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington 「<a href="http://www.serverwatch.com/tutorials/article.php/1132731">Keeping Your Images from Adorning Other Sites</a>
02d8e643ea6679beff181a2b2b3946b8fe014fecAndreas Gustafsson 」を参照してください。</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington </div></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<div class="bottomlang">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<p><span>言語: </span><a href="/en/env.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley<a href="/ja/env.html" title="Japanese">&nbsp;ja&nbsp;</a> |
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley<a href="/ko/env.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
3e9b51fc7b2d12c88298f5b777f9075feb52f071Bob Halley<a href="/tr/env.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington</div><div id="footer">
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div>
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington</body></html>