| <?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: 421100:654723 (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="bind.xml.meta"> |
| |
| <title>バインド</title> |
| |
| <summary> |
| <p>Apache が使用するアドレスとポートの設定をします。</p> |
| </summary> |
| |
| <seealso><a href="vhosts/">バーチャルホスト</a></seealso> |
| <seealso><a href="dns-caveats.html">DNS の問題</a></seealso> |
| |
| <section id="overview"> |
| <title>概要</title> |
| |
| <related> |
| <modulelist> |
| <module>core</module> |
| <module>mpm_common</module> |
| </modulelist> |
| <directivelist> |
| <directive module="core" type="section">VirtualHost</directive> |
| <directive module="mpm_common">Listen</directive> |
| </directivelist> |
| </related> |
| |
| |
| <p>Apache は起動時に、ローカルマシンのあるポートおよびアドレス |
| に対して接続し、リクエストが来るのを待ちます。 |
| デフォルトではマシンのすべてのアドレスに対して listen します。 |
| しかしながら、特定のポートか、特定のアドレスのみか、 |
| またはそれらの組み合わせのいずれかを listen するようにする必要があります。 |
| これは、異なる IP アドレス、ホスト名、ポートに対する Apache |
| の応答方法を決定するバーチャルホスト機能と組み合わせて使われます。</p> |
| |
| <p><directive module="mpm_common">Listen</directive> |
| ディレクティブで、特定のポートやアドレス・ポートの組からのみ入ってくる |
| リクエストを受け付けるようにできます。 |
| もしポート番号のみが <directive module="mpm_common">Listen</directive> |
| ディレクティブで指定された場合は、 |
| すべてのインターフェースの与えられたポート番号を |
| listen します。 IP アドレスがポート番号と同時に与えられた場合は、 |
| サーバは与えられたポートとインターフェースを listen します。 |
| 複数の <directive module="mpm_common">Listen</directive> ディレクティブを用いて |
| いくつかの listen するアドレスとポートを指定できます。 |
| サーバはリストされたアドレスやポートからのすべてのリクエストに |
| 対して応答します。</p> |
| |
| <p>たとえば、ポート 80 と 8000 の両方に対しての接続を受け付けるには</p> |
| |
| <example> |
| Listen 80<br /> |
| Listen 8000 |
| </example> |
| |
| <p>とします。 |
| 二つの指定されたインタフェースとポート番号に対しての接続を受け付けるには、 |
| </p> |
| |
| <example> |
| Listen 192.0.2.1:80<br /> |
| Listen 192.0.2.5:8000 |
| </example> |
| |
| <p>とします。 |
| IPv6 アドレスは、角括弧で次の例のように囲まなければいけません。</p> |
| |
| <example> |
| Listen [2001:db8::a00:20ff:fea7:ccea]:80 |
| </example> |
| </section> |
| |
| <section id="ipv6"> |
| <title>IPv6 の特記事項</title> |
| |
| <p>多くのプラットホームで IPv6 がサポートされてきていて、 |
| <glossary>APR</glossary> はこれらのほとんどで IPv6 をサポートしているので、 |
| Apache は IPv6 ソケットを割り当てて IPv6 |
| 経由で送られてきたリクエストを扱うことができます。</p> |
| |
| <p>IPv6 ソケットが IPv4 と IPv6 コネクションの両方を扱うことができるか |
| どうかは、Apache 管理者にとって厄介な問題です。 |
| IPv4 コネクションを IPv6 ソケットで扱う場合は、 |
| IPv4 マップされた IPv6 アドレスを使用していて、 |
| ほとんどのプラットホームではデフォルトで使用可能ですが、 |
| FreeBSD, NetBSD, OpenBSD では、システム全体としてのポリシーとの整合性から、 |
| デフォルトでは使用不可に設定されています。 |
| これらのデフォルトで使用不可のプラットホームであっても、 |
| 特別な <program>configure</program> の |
| 設定パラメータで Apache の挙動を変化させることができます。</p> |
| |
| <p>一方で、Linux や Tru64 といったプラットホームで IPv4 と IPv6 |
| の両方を扱うには、マップトアドレスを使用する<strong>以外の方法はありません</strong>。 |
| IPv4 と IPv6 のコネクションを最小限のソケットで扱いたいのであれば、 |
| IPv4 マップの IPv6 アドレスを使用する必要があり、 |
| <code>--enable-v4-mapped</code> <program>configure</program> |
| オプションを指定します。</p> |
| |
| <p><code>--enable-v4-mapped</code> は、 |
| FreeBSD, NetBSD, OpenBSD 以外の全てのプラットホームでのデフォルトです。 |
| ですから、おそらくお手元の Apache はこの設定でビルドされているでしょう。</p> |
| |
| <p>プラットフォームや APR が何をサポートするかに関わらず、 |
| IPv4 コネクションのみを扱うようにしたい場合は、 |
| 次の例のように全ての |
| <directive module="mpm_common">Listen</directive> ディレクティブで |
| IPv4 アドレスを指定してください。</p> |
| |
| <example> |
| Listen 0.0.0.0:80<br /> |
| Listen 192.0.2.1:80 |
| </example> |
| |
| <p>条件を満たすプラットホームで、Apache が |
| IPv4 と IPv6 のコネクションを個別のソケットで扱うようにしたい場合 |
| (つまり IPv4 マップのアドレスを無効にしたい場合) |
| は、<code>--disable-v4-mapped</code> |
| <program>configure</program> |
| オプションを指定して、次のように個別指定の |
| <directive module="mpm_common">Listen</directive> |
| ディレクティブを使用してください。 |
| <code>--disable-v4-mapped</code> は、 |
| FreeBSD, NetBSD, OpenBSD プラットホームでのデフォルトです。</p> |
| </section> |
| |
| <section id="virtualhost"> |
| <title>バーチャルホストに対してどう働くのか</title> |
| |
| <p><directive module="mpm_common">Listen</directive> |
| でバーチャルホストが実装されるわけではありません。 |
| Listen は単にメインサーバにどのアドレスとポートを listen すべきかを |
| 教えるだけです。 |
| <directive module="core" type="section">VirtualHost</directive> |
| ディレクティブが使われない場合は、 |
| 受け入れたリクエストすべてに対して全く同じ挙動をします。 |
| しかしながら |
| <directive module="core" type="section">VirtualHost</directive> |
| を使って、 |
| 一つ以上のアドレスやポートに対して異なる挙動をするように |
| 指定することができます。 |
| VirtualHost を実装するには、使用するアドレスとポートを |
| まず初めにサーバに通知しなければなりません。 |
| そして、その指定したアドレスとポートでの |
| このバーチャルホストの挙動を設定するために、 |
| <directive module="core" type="section">VirtualHost</directive> |
| セクションを作ります。もし |
| <directive module="core" type="section">VirtualHost</directive> |
| が listen していないアドレスとポートに対して |
| 設定されてしまうと、 |
| それにはアクセスできないということに注意してください。</p> |
| </section> |
| </manualpage> |