From 79e9c7825ba82bf10d0f926b379eeea7c0e185e5 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 5 Jun 2016 08:06:46 +0000 Subject: [PATCH] Backport r1746754 Synch with trunk, merge r1628690 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1746871 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/core.xml | 7 ++--- docs/manual/vhosts/examples.xml | 47 ++++++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index 4ea46bb3d9..7fa1b42287 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -3944,7 +3944,8 @@ to name-virtual hosts >ServerAlias is used, with no different precedence for wildcards (nor for ServerName vs. ServerAlias).

-

The complete list of names in the VirtualHost +

The complete list of names in the VirtualHost directive are treated just like a (non wildcard) ServerAlias.

@@ -3967,13 +3968,13 @@ itself

ServerName is used (possibly - in conjunction with ServerAlias) to uniquely + in conjunction with ServerAlias) to uniquely identify a virtual host, when using name-based virtual hosts.

Additionally, this is used when creating self-referential redirection URLs when - UseCanonicalName is set to a non-default + UseCanonicalName is set to a non-default value.

For example, if the name of the diff --git a/docs/manual/vhosts/examples.xml b/docs/manual/vhosts/examples.xml index 44540348e6..6a87b7842e 100644 --- a/docs/manual/vhosts/examples.xml +++ b/docs/manual/vhosts/examples.xml @@ -38,10 +38,9 @@

Running several name-based web sites on a single IP address. -

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 - www.example.com and www.example.org on this - machine.

+

Your server has multiple hostnames that resolve to a single address, + and you want to respond differently for www.example.com + and www.example.org.

Note

Creating virtual host configurations on your Apache server does not magically @@ -59,7 +58,7 @@ Listen 80 <VirtualHost *:80> DocumentRoot "/www/example1" ServerName www.example.com - + # Other directives here </VirtualHost> @@ -77,15 +76,21 @@ Listen 80 in the configuration file, it has the highest priority and can be seen as the default or primary server. That means that if a request is received that does not match one of the specified - ServerName directives, it will be served by this first - VirtualHost.

+ ServerName directives, it will be served by this first + VirtualHost.

+ +

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.

Note -

You can, if you wish, replace * with the actual - IP address of the system, when you don't care to discriminate based - on the IP address or port.

+

You may replace * 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.

However, it is additionally useful to use * on systems where the IP address is not predictable - for @@ -95,12 +100,6 @@ Listen 80 would work without changes whenever your IP address changes.

- -

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.

-
Name-based hosts on more than one @@ -126,14 +125,14 @@ DocumentRoot "/www/mainserver" <VirtualHost 172.20.30.50> DocumentRoot "/www/example1" ServerName www.example.com - + # Other directives here ... </VirtualHost> <VirtualHost 172.20.30.50> DocumentRoot "/www/example2" ServerName www.example.org - + # Other directives here ... </VirtualHost> </highlight> @@ -158,8 +157,8 @@ 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 <directive type="section" module="core" + >VirtualHost</directive> section.</p> <highlight language="config"> <VirtualHost 192.168.1.1 172.20.30.40> @@ -170,7 +169,7 @@ DocumentRoot "/www/mainserver" </highlight> <p>Now requests from both networks will be served from the same - <code>VirtualHost</code>.</p> + <directive type="section" module="core">VirtualHost</directive>.</p> <note> <title>Note:

On the internal @@ -338,7 +337,7 @@ Listen 80 <VirtualHost *:*> ProxyPreserveHost On - ProxyPass "/" "http://192.168.111.2/" + ProxyPass "/" "http://192.168.111.2/" ProxyPassReverse "/" "http://192.168.111.2/" ServerName hostname.example.com </VirtualHost> @@ -408,7 +407,7 @@ Listen 80 <VirtualHost _default_:80> -DocumentRoot "/www/default" + DocumentRoot "/www/default" ... </VirtualHost> @@ -486,7 +485,7 @@ DocumentRoot "/www/example1" </VirtualHost> <VirtualHost 172.20.30.40> -DocumentRoot "/www/subdomain/sub1" + DocumentRoot "/www/subdomain/sub1" ServerName www.sub1.domain.tld ServerPath "/sub1/" RewriteEngine On -- 2.40.0