ip-based.xml revision 49038652341bbe660a629c860507622583f8fdf0
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<manualpage>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<a href="name-based.html">Name-based Virtual Hosts Support</a>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<section id="requirements"><title>System requirements</title>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>As the term <cite>IP-based</cite> indicates, the server
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen <strong>must have a different IP address for each IP-based
3f08db06526d6901aa08c110b5bc7dde6bc39905nd virtual host</strong>. This can be achieved by the machine
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd having several physical network connections, or by use of
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd virtual interfaces which are supported by most modern operating
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd systems (see system documentation for details, these are
3f08db06526d6901aa08c110b5bc7dde6bc39905nd frequently called "ip aliases", and the "ifconfig" command is
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd most commonly used to set them up).</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>There are two ways of configuring apache to support multiple
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem hosts. Either by running a separate httpd daemon for each
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem hostname, or by running a single daemon which supports all the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd virtual hosts.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <li>There are security partitioning issues, such as company1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd does not want anyone at company2 to be able to read their
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh data except via the web. In this case you would need two
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd daemons, each running with different <directive
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd href="/misc/descriptors.html">file descriptor
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd requirements</a> of listening to every IP alias on the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd machine. It's only possible to <directive
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd address, or to specific addresses. So if you have a need to
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd listen to a specific address for whatever reason, then you
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd will need to listen to all specific addresses. (Although one
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd httpd could listen to N-1 of the addresses, and another could
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd listen to the remaining address.)</li>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <li>Sharing of the httpd configuration between virtual hosts
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd is acceptable.</li>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <li>The machine services a large number of requests, and so
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd the performance loss in running separate daemons may be
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd significant.</li>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<section id="multiple"><title>Setting up multiple daemons</title>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>Create a separate httpd installation for each virtual host. For
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd each installation, use the <directive
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd configuration file to select which IP address (or virtual host)
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd </example>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>It is recommended that you use an IP address instead of a
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd hostname (see <a href="/dns-caveats.html">DNS caveats</a>).</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd with virtual hosts</title>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>For this case, a single httpd will service requests for the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd main server and all the virtual hosts. The <directive
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd in the configuration file is used to set the values of <directive
0d0ba3a410038e179b695446bb149cce6264e0abnd or <directive module="mod_log_config">CustomLog</directive>
727872d18412fc021f03969b8641810d8896820bhumbedooh configuration directives to different values for each virtual
0d0ba3a410038e179b695446bb149cce6264e0abnd ServerAdmin webmaster@mail.smallco.com<br />
0d0ba3a410038e179b695446bb149cce6264e0abnd </VirtualHost><br />
0d0ba3a410038e179b695446bb149cce6264e0abnd ServerAdmin webmaster@mail.baygroup.org<br />
0d0ba3a410038e179b695446bb149cce6264e0abnd </VirtualHost>
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd </example>
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd <p>It is recommended that you use an IP address instead of a
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd hostname (see <a href="/dns-caveats.html">DNS caveats</a>).</p>