bind.html.en revision 50337bc37d6a337217f0295bc57aaac558517c11
181e56d8b348d301d615ccf5465ae600fee2867berikabele<?xml version="1.0" encoding="ISO-8859-1"?>
181e56d8b348d301d615ccf5465ae600fee2867berikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
181e56d8b348d301d615ccf5465ae600fee2867berikabele<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki This file is generated from xml source: DO NOT EDIT
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5a58787efeb02a1c3f06569d019ad81fd2efa06end -->
5a58787efeb02a1c3f06569d019ad81fd2efa06end<title>Binding - Apache HTTP Server</title>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<link href="/images/favicon.ico" rel="shortcut icon" /></head>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<body id="manual-page"><div id="page-header">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz<p class="apache">Apache HTTP Server Version 2.3</p>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<img alt="" src="/images/feather.gif" /></div>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div id="path">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Binding</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p><span>Available Languages: </span><a href="/de/bind.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<a href="/en/bind.html" title="English">&nbsp;en&nbsp;</a> |
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<a href="/fr/bind.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/bind.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ko/bind.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
b442af56a5e2104663b84fb345c070ce185d4ab3slive <p>Configuring Apache to listen on specific addresses and ports.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end </div>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#overview">Overview</a></li>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<li><img alt="" src="/images/down.gif" /> <a href="#ipv6">Special IPv6 Considerations</a></li>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<li><img alt="" src="/images/down.gif" /> <a href="#virtualhost">How This Works With Virtual Hosts</a></li>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</ul><h3>See also</h3><ul class="seealso"><li><a href="vhosts/">Virtual Hosts</a></li><li><a href="dns-caveats.html">DNS Issues</a></li></ul></div>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="section">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="overview" id="overview">Overview</a></h2>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4nd
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/core.html">core</a></code></li><li><code class="module"><a href="/mod/mpm_common.html">mpm_common</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code></li><li><code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code></li></ul></td></tr></table>
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4nd
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4nd
b442af56a5e2104663b84fb345c070ce185d4ab3slive <p>When Apache starts, it binds to some port and address on
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen the local machine and waits for incoming requests. By default,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem it listens to all addresses on the machine. However, it may need to
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem be told to listen on specific ports, or only on selected
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem addresses, or a combination of both. This is often combined with the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem Virtual Host feature, which determines how Apache responds to
cd694e2baec0c53e1b764ffe52ef88dcb68cfd53jerenkrantz different IP addresses, hostnames and ports.</p>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <p>The <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki directive tells the server to accept
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem incoming requests only on the specified ports or
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen address-and-port combinations. If only a port number is
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim specified in the <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki directive, the server
cd694e2baec0c53e1b764ffe52ef88dcb68cfd53jerenkrantz listens to the given port on all interfaces. If an IP address
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen is given as well as a port, the server will listen on the given
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim port and interface. Multiple <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> directives may be used to
b442af56a5e2104663b84fb345c070ce185d4ab3slive specify a number of addresses and ports to listen on. The
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen server will respond to requests from any of the listed
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen addresses and ports.</p>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen <p>For example, to make the server accept connections on both
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem port 80 and port 8000, on all interfaces, use:</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
181e56d8b348d301d615ccf5465ae600fee2867berikabele <div class="example"><p><code>
181e56d8b348d301d615ccf5465ae600fee2867berikabele Listen 80<br />
b442af56a5e2104663b84fb345c070ce185d4ab3slive Listen 8000
181e56d8b348d301d615ccf5465ae600fee2867berikabele </code></p></div>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>To make the server accept connections on port 80 for one interface,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem and port 8080 on another, use</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
181e56d8b348d301d615ccf5465ae600fee2867berikabele <div class="example"><p><code>
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirin Listen 192.0.2.1:80<br />
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirin Listen 192.0.2.5:8000
181e56d8b348d301d615ccf5465ae600fee2867berikabele </code></p></div>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>IPv6 addresses must be enclosed in square brackets, as in the
b442af56a5e2104663b84fb345c070ce185d4ab3slive following example:</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
181e56d8b348d301d615ccf5465ae600fee2867berikabele <div class="example"><p><code>
5383fa753e1bcd3a04ec34ba9810d671302380f2colm Listen [2001:db8::a00:20ff:fea7:ccea]:80
181e56d8b348d301d615ccf5465ae600fee2867berikabele </code></p></div>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="section">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="ipv6" id="ipv6">Special IPv6 Considerations</a></h2>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
b442af56a5e2104663b84fb345c070ce185d4ab3slive
20189240503ef2c8f5dc6e2248b57faab4b23b5and <p>A growing number of platforms implement IPv6, and
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a> supports IPv6 on most of these platforms,
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem allowing Apache to allocate IPv6 sockets, and to handle requests sent
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem over IPv6.</p>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick <p>One complicating factor for Apache administrators is whether or
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick not an IPv6 socket can handle both IPv4 connections and IPv6
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick connections. Handling IPv4 connections with an IPv6 socket uses
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick IPv4-mapped IPv6 addresses, which are allowed by default on most
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem platforms, but are disallowed by default on FreeBSD, NetBSD, and
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem OpenBSD, in order to match the system-wide policy on those
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem platforms. On systems where it is disallowed by default, a
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim special <code class="program"><a href="/programs/configure.html">configure</a></code> parameter can change this behavior
9bcfc3697a91b5215893a7d0206865b13fc72148nd for Apache.</p>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p>On the other hand, on some platforms, such as Linux and Tru64, the
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley <strong>only</strong> way to handle both IPv6 and IPv4 is to use
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley mapped addresses. If you want Apache to handle IPv4 and IPv6 connections
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley with a minimum of sockets, which requires using IPv4-mapped IPv6
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim addresses, specify the <code>--enable-v4-mapped</code> <code class="program"><a href="/programs/configure.html">configure</a></code> option.</p>
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem <p><code>--enable-v4-mapped</code> is the default on all platforms except
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick FreeBSD, NetBSD, and OpenBSD, so this is probably how your Apache was
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick built.</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick <p>If you want Apache to handle IPv4 connections only, regardless of
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick what your platform and APR will support, specify an IPv4 address on all
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> directives, as in the
35618dd145853155d4c7b1d0d6391707315f957ekess following examples:</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
181e56d8b348d301d615ccf5465ae600fee2867berikabele <div class="example"><p><code>
b4600e71d7e8201b3c14c67f4ef873cadd4c1d17trawick Listen 0.0.0.0:80<br />
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirin Listen 192.0.2.1:80
181e56d8b348d301d615ccf5465ae600fee2867berikabele </code></p></div>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley <p>If your platform supports it and you want Apache to handle IPv4 and
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem IPv6 connections on separate sockets (i.e., to disable IPv4-mapped
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim addresses), specify the <code>--disable-v4-mapped</code> <code class="program"><a href="/programs/configure.html">configure</a></code> option. <code>--disable-v4-mapped</code> is the
9bcfc3697a91b5215893a7d0206865b13fc72148nd default on FreeBSD, NetBSD, and OpenBSD.</p>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="section">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="virtualhost" id="virtualhost">How This Works With Virtual Hosts</a></h2>
b442af56a5e2104663b84fb345c070ce185d4ab3slive
455a5f75c9935108a7ac1d50996f404e0553ac17paul
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <p> The <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> directive does not implement
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem Virtual Hosts - it only tells the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem main server what addresses and ports to listen on. If no
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki directives are used, the server will behave
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem in the same way for all accepted requests. However,
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki can be used to specify a different behavior
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem for one or more of the addresses or ports. To implement a
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen VirtualHost, the server must first be told to listen to the
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki address and port to be used. Then a
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> section
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem should be created for the specified address and port to set the
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen behavior of this virtual host. Note that if the
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki is set for an address and port that the
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen server is not listening to, it cannot be accessed.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end </div></div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="bottomlang">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p><span>Available Languages: </span><a href="/de/bind.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<a href="/en/bind.html" title="English">&nbsp;en&nbsp;</a> |
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<a href="/fr/bind.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/bind.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ko/bind.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div><div id="footer">
50337bc37d6a337217f0295bc57aaac558517c11jim<p class="apache">Copyright 2007 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>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</body></html>