1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
4 <!-- English Revision: 645883:675568 (outdated) -->
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
14 http://www.apache.org/licenses/LICENSE-2.0
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.
23 <modulesynopsis metafile="mod_access_compat.xml.meta">
25 <name>mod_access_compat</name>
26 <description>ホスト (名前もしくは IP アドレス) に基づいたグループ承認</description>
27 <status>Extension</status>
28 <sourcefile>mod_access_compat.c</sourcefile>
29 <identifier>access_compat_module</identifier>
30 <compatibility>Apache 2.3 (Apache 2.x の以前のバージョンとの互換性のためのモジュールとして)。
31 このモジュールで提供するディレクティブは、承認の仕組みの一新に伴い、非推奨になったものです。
32 <module>mod_authz_host</module> も見てください。</compatibility>
35 <p><module>mod_access_compat</module> により提供されるディレクティブは
37 アクセスを制御するために <directive module="core" type="section"
38 >Directory</directive>, <directive module="core"
39 type="section">Files</directive>, <directive module="core"
40 type="section">Location</directive>
41 と <code><a href="core.html#accessfilename">.htaccess</a
42 ></code> ファイルで使用されます。クライアントのホスト名、IP
43 アドレスや、<a href="../env.html">環境変数</a
45 アクセス制御を行なうことができます。<directive
46 module="mod_access_compat">Allow</directive> と
47 <directive module="mod_access_compat">Deny</directive> ディレクティブを使って、
50 <directive module="mod_access_compat">Order</directive> ディレクティブを使って、
52 <directive module="mod_access_compat">Allow</directive> ディレクティブと
53 <directive module="mod_access_compat">Deny</directive>
54 ディレクティブとのお互いへの影響の仕方を設定します。
57 <p>ホストによるアクセス制限とパスワードによる認証を、
59 この場合、その二つの制限の関係を指定するために
60 <directive module="mod_access_compat">Satisfy</directive>
63 <note type="warning"><title>Note</title>
64 <p><module>mod_access_compat</module>が提供するディレクティブは、
65 承認の仕組みの一新に伴い、非推奨になったものです。
66 <module>mod_authz_host</module> も見てください。
67 デフォルトの承認の取り扱い機能を使用するために
68 <module>mod_authz_default</module>
69 モジュールもロードされなければなりません。</p>
72 <p>一般的には、アクセス制限ディレクティブはすべてのアクセスメソッド
73 (<code>GET</code>, <code>PUT</code>, <code>POST</code> など)
74 に適用されます。そして、ほとんどの場合これが望ましい動作です。
75 しかし、<directive module="core" type="section">Limit</directive>
76 セクションの中にディレクティブを書くことで、
77 一部のメソッドにのみ制限をかけることもできます。</p>
80 <seealso><directive module="mod_authz_core">Require</directive></seealso>
81 <seealso><module>mod_authz_host</module></seealso>
82 <seealso><module>mod_authz_core</module></seealso>
86 <description>サーバのある領域にアクセスできるホストを制御する</description>
87 <syntax> Allow from all|<var>host</var>|env=<var>env-variable</var>
88 [<var>host</var>|env=<var>env-variable</var>] ...</syntax>
89 <contextlist><context>directory</context><context>.htaccess</context>
91 <override>Limit</override>
94 <p><directive>Allow</directive> ディレクティブは、どのホストが
95 サーバのある領域にアクセスできるかに影響を与えます。
96 アクセスはホスト名、IP アドレス、IP アドレスの範囲や、
98 特徴に基づいてアクセス制御することができます。</p>
100 <p>このディレクティブの最初の引数は常に <code>from</code> です。
101 それに続く引数は三つの違った形式があります。<code>Allow from
102 all</code> が指定されていれば、すべてのホストにアクセスを許可し、
104 <directive module="mod_access_compat">Deny</directive>
105 ディレクティブと <directive module="mod_access_compat">Order</directive>
107 特定のホストやホスト群にのみサーバへのアクセスを許可するためには、
108 以下のどれかの形式で <em>host</em> を指定することができます:</p>
114 <example><title>例</title>
115 Allow from apache.org<br />
116 Allow from .net example.edu
118 <p>この文字列に合うか、これで終わる名前のホストのアクセスが許可されます。
119 各部分が完全に合うものだけに適用されますので、上の例は
120 <code>foo.apache.org</code> にはマッチしますが、
121 <code>fooapache.org</code> にはマッチしません。
123 <directive module="core">HostnameLookups</directive>
124 の設定に関わらず、クライアントの IP アドレスに対して
126 ホスト名からオリジナルの IP アドレスを順引きします。
127 順引きと逆引きが一致し、ホスト名が該当した場合にのみ、
128 アクセスが許可されます。</p></dd>
133 <example><title>例</title>
134 Allow from 10.1.2.3<br />
135 Allow from 192.168.1.104 192.168.1.205
137 <p>アクセスを許可する IP アドレスです。</p></dd>
142 <example><title>例</title>
143 Allow from 10.1<br />
144 Allow from 10 172.20 192.168.2
147 アドレスの最初の一つから三つまでのバイトです。</p></dd>
149 <dt>ネットワーク/ネットマスク の対</dt>
152 <example><title>例</title>
153 Allow from 10.1.0.0/255.255.0.0
155 <p>ネットワーク a.b.c.d とネットマスク w.x.y.z です。
156 より細粒度のサブネット制限用です。</p></dd>
158 <dt>ネットワーク/nnn CIDR 指定</dt>
161 <example><title>例</title>
162 Allow from 10.1.0.0/16
164 <p>ネットマスクが nnn の上位ビットが 1
165 となっているものからなること以外は前のものと同じです。</p></dd>
168 <p>注: 最後の三つの例はまったく同じホストに合います。</p>
171 <p>IPv6 アドレスと IPv6 のサブネットは以下のように指定できます:</p>
174 Allow from 2001:db8::a00:20ff:fea7:ccea<br />
175 Allow from 2001:db8::a00:20ff:fea7:ccea/10
178 <p><directive>Allow</directive> ディレクティブの引数の三つ目の形式は、
179 <a href="../env.html">環境変数</a>
180 の存在によりアクセスの制御を行なえるようにするものです。
181 <code>Allow from env=<var>env-variable</var></code>
182 が指定されていると、環境変数 <var>env-variable</var>
183 が存在した場合にリクエストはアクセスを許可されます。サーバは
184 <module>mod_setenvif</module>
185 のディレクティブにより、クライアントのリクエスト
186 の特徴に基づいて柔軟に環境変数を設定する機能を提供します。
187 ですから、このディレクティブはクライアントの
188 <code>User-Agent</code> (ブラウザの種類)、<code>Referer</code>
189 や他の HTTP リクエストのヘッダフィールドなどに基づいて
190 アクセス許可をするために使うことができます。
193 <example><title>Example:</title>
194 SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in<br />
195 <Directory /docroot><br />
197 Order Deny,Allow<br />
199 Allow from env=let_me_in<br />
204 <p>この場合、user-agent の文字列が <code>KnockKnock/2.0</code>
205 で始まるブラウザのみがアクセスが許可され、
206 他のものはアクセスが拒否されます。</p>
213 <description>サーバがアクセスを拒否するホストを制御する</description>
214 <syntax> Deny from all|<var>host</var>|env=<var>env-variable</var>
215 [<var>host</var>|env=<var>env-variable</var>] ...</syntax>
216 <contextlist><context>directory</context><context>.htaccess</context>
218 <override>Limit</override>
221 アドレス、環境変数に基づいてサーバへのアクセスを制限します。
222 <directive>Deny</directive> ディレクティブの引数は <directive
223 module="mod_access_compat">Allow</directive>
224 ディレクティブとまったく同じです。</p>
231 <description>デフォルトのアクセス可能な状態と、<directive>Allow</directive> と
232 <directive>Deny</directive> が評価される順番を制御する</description>
233 <syntax> Order <var>ordering</var></syntax>
234 <default>Order Deny,Allow</default>
235 <contextlist><context>directory</context><context>.htaccess</context>
237 <override>Limit</override>
241 <p><directive>Order</directive> ディレクティブは <directive
242 module="mod_access_compat">Allow</directive> ディレクティブと<directive
243 module="mod_access_compat">Deny</directive> と共に"3段階アクセス制御システム"
244 を制御します。第1段階目では <directive>Order</directive> ディレクティブで1番目に
245 指定したディレクティブ(<directive module="mod_access_compat">Allow</directive>
246 または <directive module="mod_access_compat">Deny</directive>)を全て処理します。
247 第2段階目で、残りのディレクティブ(<directive
248 module="mod_access_compat">Deny</directive> または <directive
249 module="mod_access_compat">Allow</directive>)
250 を全て処理します。第3段階目で、第1段階目と第2段階目で
251 マッチしなかったリクエストを処理します。</p>
253 <p>全ての <directive module="mod_access_compat">Allow</directive> と <directive
254 module="mod_access_compat">Deny</directive> が処理され、結局のところ最後にマッチ
255 した条件が有効となることに注意してください。これは最初にマッチした条件だけが有効
256 となる、典型的なファイアウォールの動作とは異なっています。
257 また、設定ファイルに書く順番には意味はありません。<directive
258 module="mod_access_compat">Allow</directive> 行は全部一つのグループとして扱われ、
259 <directive module="mod_access_compat">Deny</directive> 行はもう一つのグループとみなされます。
260 またデフォルト状態は単独で一つのグループとみなされます。</p>
262 <p><em>Order</em> 設定は以下の以下のどれかです。</p>
265 <dt><code>Allow,Deny</code></dt>
267 <dd>まず <directive module="mod_access_compat">Allow</directive>
268 ディレクティブが適用されます。どれにもマッチしなかった場合、この時点で
269 リクエストは拒否されます。次に、全ての <directive module="mod_access_compat">
270 Deny</directive> ディレクティブが適用されます。どれか一つでもマッチした場合は、
272 最後に、 <directive module="mod_access_compat">Allow</directive> にも <directive
273 module="mod_access_compat">Deny</directive> にもマッチしなかったリクエストは
274 デフォルト設定が適用されるので拒否されます。</dd>
276 <dt><code>Deny,Allow</code></dt>
278 <dd>まず <directive module="mod_access_compat">Deny</directive>
279 ディレクティブが適用されます。どれか一つでもマッチした場合は、
280 <directive module="mod_access_compat">Allow</directive> のどれにも
281 マッチ<strong>しなければ</strong>、アクセスは拒否されます。
282 どの <directive module="mod_access_compat">Allow</directive> にも <directive
283 module="mod_access_compat">Deny</directive> にもマッチしないリクエストは
286 <dt><code>Mutual-failure</code></dt>
288 <dd>これは <code>Order Allow,Deny</code> と全く同じ効果を持ち、
293 <p>キーワードの間に置けるのはコンマだけです。
294 間に<em>空白があってはいけません</em>。</p>
299 <th>Allow,Deny 時の結果</th>
300 <th>Deny,Allow 時の結果</th>
302 <th>Allow だけにマッチ</th>
311 <td>2番目のディレクティブがデフォルト: 拒否</td>
312 <td>2番目のディレクティブがデフォルト: 許可</td>
314 <th>Allow と Deny 両方にマッチ</th>
315 <td>最後にマッチしたほう: 拒否</td>
316 <td>最後にマッチしたほう: 許可</td>
321 ドメインのすべてのホストはアクセスを許可されます。
322 他のすべてのホストはアクセスを拒否されます。</p>
325 Order Deny,Allow<br />
327 Allow from apache.org
330 <p>次の例では、foo.apache.org サブドメインにあるホスト以外の、
331 apache.org ドメインのすべてのホストがアクセスを許可されます。
333 ドメインでないホストは、デフォルトの状態が <directive
334 module="mod_access_compat">Deny</directive> のため、
335 サーバへのアクセスを拒否されます。</p>
338 Order Allow,Deny<br />
339 Allow from apache.org<br />
340 Deny from foo.apache.org
343 <p>一方、上の例の <directive>Order</directive> が <code>Deny,Allow</code>
344 に変わっていれば、すべのホストにアクセスが許可されます。
345 これは、設定ファイル中の実際の順番に関わらず、
346 <code>Allow from apache.org</code> が最後に評価されて、
347 <code>Deny from foo.apache.org</code> を上書きするからです。
348 <code>apache.org</code>
349 ドメインにないホストも、デフォルトの状態が <directive
350 module="mod_access_compat">Allow</directive>
354 <p><directive>Order</directive>
355 ディレクティブはデフォルトのアクセスの状態に影響を与えるので、
356 <directive module="mod_authz_host">Allow</directive> ディレクティブと
357 <directive module="mod_authz_host">Deny</directive>
358 ディレクティブが無くても、サーバのアクセスに影響を与えることができます。
362 <Directory /www><br />
364 Order Allow,Deny<br />
370 <directive module="mod_access_compat">Deny</directive> になるため、
371 <code>/www</code> ディレクトリへのすべてのアクセスを拒否します。
374 <p><directive>Order</directive>
375 ディレクティブはサーバの設定処理の各段階でだけ
376 アクセスディレクティブの処理の順番を変更します。これは、たとえば、
377 <directive>Order</directive> ディレクティブの設定に関わらず、
378 <directive module="core" type="section">Location</directive> セクションの
379 <directive module="mod_access_compat">Allow</directive> ディレクティブや
380 <directive module="mod_access_compat">Deny</directive> ディレクティブは、
381 <directive module="core" type="sectino">Directory</directive> セクションや
382 <code>.htaccess</code> ファイルの <directive
383 module="mod_access_compat">Allow</directive>
384 ディレクティブや <directive module="mod_access_compat">Deny</directive>
385 ディレクティブよりも常に後に評価されるということを意味します。
387 <a href="../sections.html">Directory,Location, Files
388 セクションの動作方法</a> を参照してください。</p>
394 <description>ホストレベルのアクセス制御とユーザ認証との相互作用を指定</description>
395 <syntax>Satisfy Any|All</syntax>
396 <default>Satisfy All</default>
397 <contextlist><context>directory</context><context>.htaccess</context>
399 <override>AuthConfig</override>
400 <compatibility>バージョン 2.0.51 以降では <directive module="core" type="section"
401 >Limit</directive> ディレクティブと <directive module="core"
402 type="section">LimitExcept</directive> ディレクティブの影響を受ける
406 <p><directive module="mod_access_compat">Allow</directive> と
407 <directive module="mod_authz_core">Require</directive> の両方が使われているときの
408 アクセスポリシーを設定します。パラメータは <code>All</code> か <code>Any</code>
409 です。このディレクティブはある場所へのアクセスがユーザ名/パスワード
410 <em>と</em>クライアントのホストのアドレスで制限されているときにのみ
411 役立ちます。デフォルトの動作 (<code>All</code>) はクライアントがアドレスによる
412 アクセス制限を満たし、<em>かつ</em>正しいユーザ名とパスワードを入力することを
413 要求します。<code>Any</code> では、クライアントはホストの制限を満たすか、
414 正しいユーザ名とパスワードの入力をするかをすればアクセスを許可されます。
415 これは、ある場所をパスワードで保護するけれど、特定のアドレスからの
416 クライアントにはパスワードの入力を要求せずにアクセスを許可する、
419 <p>例えば、同じネットワーク上にいる人にはウェブサイトのある部分について
420 無制限のアクセスを許したいけれど、外のネットワークの人には
421 パスワードを提供させるようにするためには、次のような設定をすることが
425 Require valid-user<br />
426 Allow from 192.168.1<br />
431 <directive module="core"
432 type="section">Limit</directive> セクションと
433 <directive module="core" type="section"
434 >LimitExcept</directive> セクションを使用することで
435 <directive>Satisfy</directive> ディレクティブが
439 <seealso><directive module="mod_access_compat">Allow</directive></seealso>
440 <seealso><directive module="mod_authz_core">Require</directive></seealso>