blob: c5b8887e6c258d36e4b629c2bd32f3606637b847 [file] [log] [blame]
<?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: 587444:1673947 (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>とします。
あるインターフェースでは 80 番で、また、同時に他のインターフェースの
8000 番ポートで接続を受け付けるには、
</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 を実装するには、まず初めに使用したいアドレスとポートに対して
サーバが Listen していなければなりません。
そして、その指定したアドレスとポートでの
このバーチャルホストの挙動を設定するために、
<directive module="core" type="section">VirtualHost</directive>
セクションを作ります。もし
<directive module="core" type="section">VirtualHost</directive>
が Listen していないアドレスとポートに対して
設定されてしまうと、
それにはアクセスできないということに注意してください。</p>
</section>
</manualpage>