summaryrefslogtreecommitdiff
path: root/docs/manual/vhosts/examples.html.en
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manual/vhosts/examples.html.en')
-rw-r--r--docs/manual/vhosts/examples.html.en48
1 files changed, 23 insertions, 25 deletions
diff --git a/docs/manual/vhosts/examples.html.en b/docs/manual/vhosts/examples.html.en
index ac9fb7dc..55fe1d5f 100644
--- a/docs/manual/vhosts/examples.html.en
+++ b/docs/manual/vhosts/examples.html.en
@@ -59,16 +59,15 @@
IP-based vhost</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#serverpath">Using the <code>ServerPath</code>
directive</a></li>
-</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
+</ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="purename" id="purename">Running several name-based web
sites on a single IP address.</a></h2>
- <p>Your server has a single IP address, and multiple aliases (CNAMES)
- point to this machine in DNS. You want to run a web server for
- <code>www.example.com</code> and <code>www.example.org</code> on this
- machine.</p>
+ <p>Your server has multiple hostnames that resolve to a single address,
+ and you want to respond differently for <code>www.example.com</code>
+ and <code>www.example.org</code>.</p>
<div class="note"><h3>Note</h3><p>Creating virtual
host configurations on your Apache server does not magically
@@ -85,7 +84,7 @@ Listen 80
&lt;VirtualHost *:80&gt;
DocumentRoot "/www/example1"
ServerName www.example.com
-
+
# Other directives here
&lt;/VirtualHost&gt;
@@ -103,15 +102,21 @@ Listen 80
in the configuration file, it has the highest priority and can be seen
as the <cite>default</cite> or <cite>primary</cite> server. That means
that if a request is received that does not match one of the specified
- <code>ServerName</code> directives, it will be served by this first
- <code>VirtualHost</code>.</p>
+ <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code> directives, it will be served by this first
+ <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>.</p>
+
+ <p>The above configuration is what you will want to use in almost
+ all name-based virtual hosting situations. The only thing that this
+ configuration will not work for, in fact, is when you are serving
+ different content based on differing IP addresses or ports.</p>
<div class="note">
<h3>Note</h3>
- <p>You can, if you wish, replace <code>*</code> with the actual
- IP address of the system, when you don't care to discriminate based
- on the IP address or port.</p>
+ <p>You may replace <code>*</code> with a specific IP address
+ on the system. Such virtual hosts will only be used for
+ HTTP requests received on connection to the specified IP
+ address.</p>
<p>However, it is additionally useful to use <code>*</code>
on systems where the IP address is not predictable - for
@@ -121,12 +126,6 @@ Listen 80
would work without changes whenever your IP address
changes.</p>
</div>
-
- <p>The above configuration is what you will want to use in almost
- all name-based virtual hosting situations. The only thing that this
- configuration will not work for, in fact, is when you are serving
- different content based on differing IP addresses or ports.</p>
-
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="twoips" id="twoips">Name-based hosts on more than one
@@ -151,14 +150,14 @@ DocumentRoot "/www/mainserver"
&lt;VirtualHost 172.20.30.50&gt;
DocumentRoot "/www/example1"
ServerName www.example.com
-
+
# Other directives here ...
&lt;/VirtualHost&gt;
&lt;VirtualHost 172.20.30.50&gt;
DocumentRoot "/www/example2"
ServerName www.example.org
-
+
# Other directives here ...
&lt;/VirtualHost&gt;</pre>
@@ -183,8 +182,7 @@ DocumentRoot "/www/mainserver"
(<code>192.168.1.1</code>).</p>
<p>The server can be made to respond to internal and external requests
- with the same content, with just one <code>VirtualHost</code>
- section.</p>
+ with the same content, with just one <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> section.</p>
<pre class="prettyprint lang-config">&lt;VirtualHost 192.168.1.1 172.20.30.40&gt;
DocumentRoot "/www/server1"
@@ -194,7 +192,7 @@ DocumentRoot "/www/mainserver"
<p>Now requests from both networks will be served from the same
- <code>VirtualHost</code>.</p>
+ <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>.</p>
<div class="note">
<h3>Note:</h3><p>On the internal
@@ -356,7 +354,7 @@ Listen 172.20.30.50:8080
<pre class="prettyprint lang-config">&lt;VirtualHost *:*&gt;
ProxyPreserveHost On
- ProxyPass "/" "http://192.168.111.2/"
+ ProxyPass "/" "http://192.168.111.2/"
ProxyPassReverse "/" "http://192.168.111.2/"
ServerName hostname.example.com
&lt;/VirtualHost&gt;</pre>
@@ -423,7 +421,7 @@ Listen 172.20.30.50:8080
vhosts.</p>
<pre class="prettyprint lang-config">&lt;VirtualHost _default_:80&gt;
-DocumentRoot "/www/default"
+ DocumentRoot "/www/default"
...
&lt;/VirtualHost&gt;</pre>
@@ -498,7 +496,7 @@ DocumentRoot "/www/example1"
&lt;/VirtualHost&gt;
&lt;VirtualHost 172.20.30.40&gt;
-DocumentRoot "/www/subdomain/sub1"
+ DocumentRoot "/www/subdomain/sub1"
ServerName www.sub1.domain.tld
ServerPath "/sub1/"
RewriteEngine On