~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to docs/manual/vhosts/ip-based.html.en

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
 
4
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
5
              This file is generated from xml source: DO NOT EDIT
 
6
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
7
      -->
 
8
<title>Apache IP-based Virtual Host Support - Apache HTTP Server</title>
 
9
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
 
10
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
 
11
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
 
12
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
 
13
<body id="manual-page"><div id="page-header">
 
14
<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>
 
15
<p class="apache">Apache HTTP Server Version 2.2</p>
 
16
<img alt="" src="../images/feather.gif" /></div>
 
17
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
 
18
<div id="path">
 
19
<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.2</a> &gt; <a href="./">Virtual Hosts</a></div><div id="page-content"><div id="preamble"><h1>Apache IP-based Virtual Host Support</h1>
 
20
<div class="toplang">
 
21
<p><span>Available Languages: </span><a href="../en/vhosts/ip-based.html" title="English">&nbsp;en&nbsp;</a> |
 
22
<a href="../fr/vhosts/ip-based.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
 
23
<a href="../ja/vhosts/ip-based.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
 
24
<a href="../ko/vhosts/ip-based.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
 
25
</div>
 
26
</div>
 
27
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#requirements">System requirements</a></li>
 
28
<li><img alt="" src="../images/down.gif" /> <a href="#howto">How to set up Apache</a></li>
 
29
<li><img alt="" src="../images/down.gif" /> <a href="#multiple">Setting up multiple daemons</a></li>
 
30
<li><img alt="" src="../images/down.gif" /> <a href="#single">Setting up a single daemon
 
31
        with virtual hosts</a></li>
 
32
</ul><h3>See also</h3><ul class="seealso"><li>
 
33
<a href="name-based.html">Name-based Virtual Hosts Support</a>
 
34
</li></ul></div>
 
35
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 
36
<div class="section">
 
37
<h2><a name="requirements" id="requirements">System requirements</a></h2>
 
38
 
 
39
    <p>As the term <cite>IP-based</cite> indicates, the server
 
40
    <strong>must have a different IP address for each IP-based
 
41
    virtual host</strong>. This can be achieved by the machine
 
42
    having several physical network connections, or by use of
 
43
    virtual interfaces which are supported by most modern operating
 
44
    systems (see system documentation for details, these are
 
45
    frequently called "ip aliases", and the "ifconfig" command is
 
46
    most commonly used to set them up).</p>
 
47
 
 
48
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 
49
<div class="section">
 
50
<h2><a name="howto" id="howto">How to set up Apache</a></h2>
 
51
 
 
52
    <p>There are two ways of configuring apache to support multiple
 
53
    hosts. Either by running a separate <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon for
 
54
    each hostname, or by running a single daemon which supports all the
 
55
    virtual hosts.</p>
 
56
 
 
57
    <p>Use multiple daemons when:</p>
 
58
 
 
59
    <ul>
 
60
      <li>There are security partitioning issues, such as company1
 
61
      does not want anyone at company2 to be able to read their
 
62
      data except via the web. In this case you would need two
 
63
      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>
 
64
 
 
65
      <li>You can afford the memory and file descriptor
 
66
      requirements of listening to every IP alias on the
 
67
      machine. It's only possible to <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> to the "wildcard"
 
68
      address, or to specific addresses. So if you have a need to
 
69
      listen to a specific address for whatever reason, then you
 
70
      will need to listen to all specific addresses. (Although one
 
71
      <code class="program"><a href="../programs/httpd.html">httpd</a></code> could listen to N-1 of the addresses, and another could
 
72
      listen to the remaining address.)</li>
 
73
    </ul>
 
74
 
 
75
    <p>Use a single daemon when:</p>
 
76
 
 
77
    <ul>
 
78
      <li>Sharing of the httpd configuration between virtual hosts
 
79
      is acceptable.</li>
 
80
 
 
81
      <li>The machine services a large number of requests, and so
 
82
      the performance loss in running separate daemons may be
 
83
      significant.</li>
 
84
    </ul>
 
85
 
 
86
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 
87
<div class="section">
 
88
<h2><a name="multiple" id="multiple">Setting up multiple daemons</a></h2>
 
89
 
 
90
    <p>Create a separate <code class="program"><a href="../programs/httpd.html">httpd</a></code> installation for each
 
91
    virtual host. For each installation, use the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive in the
 
92
    configuration file to select which IP address (or virtual host)
 
93
    that daemon services. e.g.</p>
 
94
 
 
95
    <div class="example"><p><code>
 
96
    Listen www.smallco.com:80
 
97
    </code></p></div>
 
98
 
 
99
    <p>It is recommended that you use an IP address instead of a
 
100
    hostname (see <a href="../dns-caveats.html">DNS caveats</a>).</p>
 
101
 
 
102
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 
103
<div class="section">
 
104
<h2><a name="single" id="single">Setting up a single daemon
 
105
        with virtual hosts</a></h2>
 
106
 
 
107
    <p>For this case, a single <code class="program"><a href="../programs/httpd.html">httpd</a></code> will service
 
108
    requests for the main server and all the virtual hosts. The <code class="directive"><a href="../mod/core.html#virtualhost">VirtualHost</a></code> directive
 
109
    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>
 
110
    or <code class="directive"><a href="../mod/mod_log_config.html#customlog">CustomLog</a></code>
 
111
    configuration directives to different values for each virtual
 
112
    host. e.g.</p>
 
113
 
 
114
    <div class="example"><p><code>
 
115
    &lt;VirtualHost www.smallco.com&gt;<br />
 
116
    ServerAdmin webmaster@mail.smallco.com<br />
 
117
    DocumentRoot /groups/smallco/www<br />
 
118
    ServerName www.smallco.com<br />
 
119
    ErrorLog /groups/smallco/logs/error_log<br />
 
120
    TransferLog /groups/smallco/logs/access_log<br />
 
121
    &lt;/VirtualHost&gt;<br />
 
122
                <br />
 
123
    &lt;VirtualHost www.baygroup.org&gt;<br />
 
124
    ServerAdmin webmaster@mail.baygroup.org<br />
 
125
    DocumentRoot /groups/baygroup/www<br />
 
126
    ServerName www.baygroup.org<br />
 
127
    ErrorLog /groups/baygroup/logs/error_log<br />
 
128
    TransferLog /groups/baygroup/logs/access_log<br />
 
129
    &lt;/VirtualHost&gt;
 
130
                </code></p></div>
 
131
 
 
132
    <p>It is recommended that you use an IP address instead of a
 
133
    hostname (see <a href="../dns-caveats.html">DNS caveats</a>).</p>
 
134
 
 
135
    <p>Almost <strong>any</strong> configuration directive can be
 
136
    put in the VirtualHost directive, with the exception of
 
137
    directives that control process creation and a few other
 
138
    directives. To find out if a directive can be used in the
 
139
    VirtualHost directive, check the <a href="../mod/directive-dict.html#Context">Context</a> using the
 
140
    <a href="../mod/directives.html">directive index</a>.</p>
 
141
 
 
142
    <p><code class="directive"><a href="../mod/mod_suexec.html#suexecusergroup">SuexecUserGroup</a></code>
 
143
    may be used inside a
 
144
    VirtualHost directive if the <a href="../suexec.html">suEXEC
 
145
    wrapper</a> is used.</p>
 
146
 
 
147
    <p><em>SECURITY:</em> When specifying where to write log files,
 
148
    be aware of some security risks which are present if anyone
 
149
    other than the user that starts Apache has write access to the
 
150
    directory where they are written. See the <a href="../misc/security_tips.html">security tips</a> document
 
151
    for details.</p>
 
152
 
 
153
</div></div>
 
154
<div class="bottomlang">
 
155
<p><span>Available Languages: </span><a href="../en/vhosts/ip-based.html" title="English">&nbsp;en&nbsp;</a> |
 
156
<a href="../fr/vhosts/ip-based.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
 
157
<a href="../ja/vhosts/ip-based.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
 
158
<a href="../ko/vhosts/ip-based.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
 
159
</div><div id="footer">
 
160
<p class="apache">Copyright 2006 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>
 
161
<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>
 
162
</body></html>
 
 
b'\\ No newline at end of file'