ip-based.html.en revision 35714556a25fceb7c9bf9c4e01791b2e2a4c27c3
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess This file is generated from xml source: DO NOT EDIT
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5a58787efeb02a1c3f06569d019ad81fd2efa06end<title>Apache IP-based Virtual Host Support - Apache HTTP Server</title>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/images/favicon.ico" rel="shortcut icon" /></head>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<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>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.1</a> > <a href="./">Virtual Hosts</a></div><div id="page-content"><div id="preamble"><h1>Apache IP-based Virtual Host Support</h1>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/vhosts/ip-based.html" title="English"> en </a> |
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<a href="/ko/vhosts/ip-based.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#requirements">System requirements</a></li>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<li><img alt="" src="/images/down.gif" /> <a href="#howto">How to set up Apache</a></li>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<li><img alt="" src="/images/down.gif" /> <a href="#multiple">Setting up multiple daemons</a></li>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<li><img alt="" src="/images/down.gif" /> <a href="#single">Setting up a single daemon
0e13d2a04f8c7cb647556e890bb69d5789a31ce1nd<a href="name-based.html">Name-based Virtual Hosts Support</a>
2bd55c0d474884fe40c4a081efcbd82bc1c913a8rbowen<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
2bd55c0d474884fe40c4a081efcbd82bc1c913a8rbowen<h2><a name="requirements" id="requirements">System requirements</a></h2>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen <p>As the term <cite>IP-based</cite> indicates, the server
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen <strong>must have a different IP address for each IP-based
10ca15b877e1d7f36b5d4ccd0a38e984cd635da4rbowen virtual host</strong>. This can be achieved by the machine
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen having several physical network connections, or by use of
10ca15b877e1d7f36b5d4ccd0a38e984cd635da4rbowen virtual interfaces which are supported by most modern operating
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen systems (see system documentation for details, these are
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen frequently called "ip aliases", and the "ifconfig" command is
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen most commonly used to set them up).</p>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="howto" id="howto">How to set up Apache</a></h2>
be809bbd44119f26f27a701f6912d21f334d85ffrbowen <p>There are two ways of configuring apache to support multiple
ae89c529be7bde57cc051ec8f85da6fddd502926erikabele hosts. Either by running a separate httpd daemon for each
5a58787efeb02a1c3f06569d019ad81fd2efa06end hostname, or by running a single daemon which supports all the
5a58787efeb02a1c3f06569d019ad81fd2efa06end virtual hosts.</p>
2bd55c0d474884fe40c4a081efcbd82bc1c913a8rbowen <li>There are security partitioning issues, such as company1
10ca15b877e1d7f36b5d4ccd0a38e984cd635da4rbowen does not want anyone at company2 to be able to read their
10ca15b877e1d7f36b5d4ccd0a38e984cd635da4rbowen data except via the web. In this case you would need two
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess daemons, each running with different <code class="directive"><a href="/mod/mpm_common.html#user">User</a></code>, <code class="directive"><a href="/mod/mpm_common.html#group">Group</a></code>, <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>, and <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> settings.</li>
48160cfe05c7614376dc7b1f57f5493eb73f06dbrbowen <li>You can afford the memory and file descriptor
48160cfe05c7614376dc7b1f57f5493eb73f06dbrbowen requirements of listening to every IP alias on the
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen machine. It's only possible to <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> to the "wildcard"
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen address, or to specific addresses. So if you have a need to
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess listen to a specific address for whatever reason, then you
10ca15b877e1d7f36b5d4ccd0a38e984cd635da4rbowen will need to listen to all specific addresses. (Although one
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen httpd could listen to N-1 of the addresses, and another could
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen listen to the remaining address.)</li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <li>Sharing of the httpd configuration between virtual hosts
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess is acceptable.</li>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <li>The machine services a large number of requests, and so
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess the performance loss in running separate daemons may be
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen significant.</li>
b55e805b1e1f5258452901038edc7097056eba7eerikabele</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
48160cfe05c7614376dc7b1f57f5493eb73f06dbrbowen<h2><a name="multiple" id="multiple">Setting up multiple daemons</a></h2>
1855f4a7304fe643dd91b222128facaa185753e8erikabele <p>Create a separate httpd installation for each virtual host. For
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess each installation, use the <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> directive in the
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess configuration file to select which IP address (or virtual host)
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>It is recommended that you use an IP address instead of a
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd hostname (see <a href="/dns-caveats.html">DNS caveats</a>).</p>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<h2><a name="single" id="single">Setting up a single daemon
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>For this case, a single httpd will service requests for the
5a58787efeb02a1c3f06569d019ad81fd2efa06end main server and all the virtual hosts. The <code class="directive"><a href="/mod/core.html#virtualhost">VirtualHost</a></code> directive
in the configuration file is used to set the values of <code class="directive"><a href="/mod/core.html#serveradmin">ServerAdmin</a></code>, <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code>, <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>, <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code> and <code class="directive"><a href="/mod/mod_log_config.html#transferlog">TransferLog</a></code>
<p><code class="directive"><a href="/mod/mpm_common.html#user">User</a></code> and <code class="directive"><a href="/mod/mpm_common.html#group">Group</a></code> may be used inside a
directory where they are written. See the <a href="/misc/security_tips.html">security tips</a> document
<p><span>Available Languages: </span><a href="/en/vhosts/ip-based.html" title="English"> en </a> |
<a href="/ko/vhosts/ip-based.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
<p class="apache">Copyright 1999-2004 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>
<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>