ip-based.xml revision 84ef01e0cc5691422370a55f218f43f425d99a9c
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<manualpage>
b686b6a420bde7f78c416b90be11db94cb789979nd<a href="name-based.html">Name-based Virtual Hosts Support</a>
b686b6a420bde7f78c416b90be11db94cb789979nd<section id="requirements"><title>System requirements</title>
b686b6a420bde7f78c416b90be11db94cb789979nd <p>As the term <cite>IP-based</cite> indicates, the server
b686b6a420bde7f78c416b90be11db94cb789979nd <strong>must have a different IP address for each IP-based
b686b6a420bde7f78c416b90be11db94cb789979nd virtual host</strong>. This can be achieved by the machine
4b5981e276e93df97c34e4da05ca5cf8bbd937dand having several physical network connections, or by use of
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd virtual interfaces which are supported by most modern operating
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd systems (see system documentation for details, these are
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd frequently called "ip aliases", and the "ifconfig" command is
b05ab3ff5ab54aa22610b13d56eaba6ddfc3db60nd most commonly used to set them up).</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>There are two ways of configuring apache to support multiple
06ba4a61654b3763ad65f52283832ebf058fdf1cslive hosts. Either by running a separate httpd daemon for each
06ba4a61654b3763ad65f52283832ebf058fdf1cslive hostname, or by running a single daemon which supports all the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive virtual hosts.</p>
5b10fd3977e6dfff19afe770e612e276962f7950nd <li>There are security partitioning issues, such as company1
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd does not want anyone at company2 to be able to read their
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd data except via the web. In this case you would need two
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd daemons, each running with different <directive
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd href="/misc/descriptors.html">file descriptor
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd requirements</a> of listening to every IP alias on the
2aff288113d772cedca6add888eb643afffe9fb1nd machine. It's only possible to <directive
2aff288113d772cedca6add888eb643afffe9fb1nd address, or to specific addresses. So if you have a need to
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd listen to a specific address for whatever reason, then you
7fa75a06a4fee19e995c069ee00310455d1452e1pquerna will need to listen to all specific addresses. (Although one
7fa75a06a4fee19e995c069ee00310455d1452e1pquerna httpd could listen to N-1 of the addresses, and another could
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd listen to the remaining address.)</li>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd <li>Sharing of the httpd configuration between virtual hosts
2aff288113d772cedca6add888eb643afffe9fb1nd is acceptable.</li>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd <li>The machine services a large number of requests, and so
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd the performance loss in running separate daemons may be
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd significant.</li>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<section id="multiple"><title>Setting up multiple daemons</title>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd <p>Create a separate httpd installation for each virtual host. For
2aff288113d772cedca6add888eb643afffe9fb1nd each installation, use the <directive
2aff288113d772cedca6add888eb643afffe9fb1nd configuration file to select which IP address (or virtual host)
2aff288113d772cedca6add888eb643afffe9fb1nd </example>
bc525661d031758c0a4e771543372b4869ca86aand <p>It is recommended that you use an IP address instead of a
2aff288113d772cedca6add888eb643afffe9fb1nd hostname (see <a href="/dns-caveats.html">DNS caveats</a>).</p>
2aff288113d772cedca6add888eb643afffe9fb1nd with virtual hosts</title>
42af92a661a06b3cebc88d585aad75064a309d51nd <p>For this case, a single httpd will service requests for the
6fe26506780e73be2a412d758af77fafdf03291and main server and all the virtual hosts. The <directive
aa0b2780958e9b1467c9d0153a05738e399811a5nd in the configuration file is used to set the values of <directive
2aff288113d772cedca6add888eb643afffe9fb1nd or <directive module="mod_log_config">CustomLog</directive>
2aff288113d772cedca6add888eb643afffe9fb1nd configuration directives to different values for each virtual
2aff288113d772cedca6add888eb643afffe9fb1nd ServerAdmin webmaster@mail.smallco.com<br />
e67fa8d3f161e595dd448fc24a591ee17ae59131nd </VirtualHost><br />
bf94bedcb62d7f0b926f4286069def5ee6b07b60nd ServerAdmin webmaster@mail.baygroup.org<br />
ee5db395bc3723609919edfa96af387eea37c491jim </VirtualHost>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd </example>
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd <p>It is recommended that you use an IP address instead of a
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd hostname (see <a href="/dns-caveats.html">DNS caveats</a>).</p>
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive <p>Almost <strong>any</strong> configuration directive can be
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive put in the VirtualHost directive, with the exception of
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive directives that control process creation and a few other
75585bd48fe0f30483dba4762e61edf39ea3e0f6nd directives. To find out if a directive can be used in the
75585bd48fe0f30483dba4762e61edf39ea3e0f6nd VirtualHost directive, check the <a
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd href="/mod/directive-dict.html#Context">Context</a> using the
3b58542e01ec69422f3086db5825a12fc77b726end <p><directive module="mpm_common">User</directive> and <directive
a0d937b340692a3578f1d2f2535890c520c4bf0cnd module="mpm_common">Group</directive> may be used inside a
7d15331eeb5429d7148d13d6fd914a641bf1c000pquerna VirtualHost directive if the <a href="/suexec.html">suEXEC
2aff288113d772cedca6add888eb643afffe9fb1nd <p><em>SECURITY:</em> When specifying where to write log files,
2aff288113d772cedca6add888eb643afffe9fb1nd be aware of some security risks which are present if anyone
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd other than the user that starts Apache has write access to the
08842292d2f1550b40ae73e0dafc7641c5955c82nd directory where they are written. See the <a
2aff288113d772cedca6add888eb643afffe9fb1nd href="/misc/security_tips.html">security tips</a> document
d2b809e5d72658bff23819d8b77f20e4939af541nd for details.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd</manualpage>