From 10e706a838012db04f89cd6fbe801fedf64e29d4 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Mon, 18 Nov 2002 22:50:53 +0000 Subject: [PATCH] Minor clarification on a few points. Added note about what "older browsers" means. formatting on example blocks. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97566 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/vhosts/name-based.html.en | 35 ++++++++++++++++++++------ docs/manual/vhosts/name-based.xml | 36 +++++++++++++++++++++------ 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/docs/manual/vhosts/name-based.html.en b/docs/manual/vhosts/name-based.html.en index b42449e45c..f1f6fa4b36 100644 --- a/docs/manual/vhosts/name-based.html.en +++ b/docs/manual/vhosts/name-based.html.en @@ -64,18 +64,20 @@ <VirtualHost> directive should be the same as the argument to the NameVirtualHost directive (ie, an IP address, or * for all addresses). Inside each - <VirtualHost> block, you will need at minimum a / + <VirtualHost> block, you will need at minimum a ServerName directive to designate which host is served and a DocumentRoot directive to show where in the filesystem the content for that host lives.

-

If you are adding virtual hosts to an existing web server, you +

Main host goes away

+ If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as - the default host.

+ the default host. +

For example, suppose that you are serving the domain www.domain.tld and you wish to add the virtual host @@ -86,28 +88,36 @@ NameVirtualHost *

<VirtualHost *>
+ ServerName www.domain.tld
+ ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
+
</VirtualHost>

<VirtualHost *>
- ServerName www.otherdomain.tld
+ ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
+
</VirtualHost>

You can alternatively specify an explicit IP address in place of the * in both the NameVirtualHost and - <VirtualHost> directives.

+ <VirtualHost> directives. For example, you might + want to do this in order to run some name-based virtual hosts on one + IP address, and either IP-based, or another set of name-based + virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the <VirtualHost> section. For - example if you add this to the first <VirtualHost> block - above

+ example in the first <VirtualHost> block above, the ServerAlias directive indicates that the + listed names are other names which people can use to see that same + web site:

- ServerAlias domain.tld *.domain.tld + ServerAlias domain.tld *.domain.tld

then requests for all hosts in the domain.tld domain @@ -156,6 +166,13 @@ pages from the first virtual host listed for that IP address (the primary name-based virtual host).

+

How much older?

+ Please note that when we say older, we really do mean older. You are + very unlikely to encounter one of these browsers in use today. All + current versions of any browser send the Host header as + required for name-based virtual hosts. +
+

There is a possible workaround with the ServerPath directive, albeit a slightly cumbersome one:

@@ -165,9 +182,11 @@ NameVirtualHost 111.22.33.44

<VirtualHost 111.22.33.44>
+ ServerName www.domain.tld
ServerPath /domain
DocumentRoot /web/domain
+
</VirtualHost>

diff --git a/docs/manual/vhosts/name-based.xml b/docs/manual/vhosts/name-based.xml index 1067006984..5bd611e077 100644 --- a/docs/manual/vhosts/name-based.xml +++ b/docs/manual/vhosts/name-based.xml @@ -92,19 +92,21 @@ <VirtualHost> directive should be the same as the argument to the NameVirtualHost directive (ie, an IP address, or * for all addresses). Inside each - <VirtualHost> block, you will need at minimum a / + <VirtualHost> block, you will need at minimum a ServerName directive to designate which host is served and a DocumentRoot directive to show where in the filesystem the content for that host lives.

-

If you are adding virtual hosts to an existing web server, you + Main host goes away + If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as - the default host.

+ the default host. +

For example, suppose that you are serving the domain www.domain.tld and you wish to add the virtual host @@ -115,28 +117,37 @@ NameVirtualHost *

<VirtualHost *>
+ ServerName www.domain.tld
+ ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
+
</VirtualHost>

<VirtualHost *>
- ServerName www.otherdomain.tld
+ ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
+
</VirtualHost>

You can alternatively specify an explicit IP address in place of the * in both the NameVirtualHost and - <VirtualHost> directives.

+ <VirtualHost> directives. For example, you might + want to do this in order to run some name-based virtual hosts on one + IP address, and either IP-based, or another set of name-based + virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the <VirtualHost> section. For - example if you add this to the first <VirtualHost> block - above

+ example in the first <VirtualHost> block above, the ServerAlias directive indicates that the + listed names are other names which people can use to see that same + web site:

- ServerAlias domain.tld *.domain.tld + ServerAlias domain.tld *.domain.tld

then requests for all hosts in the domain.tld domain @@ -188,6 +199,13 @@ pages from the first virtual host listed for that IP address (the primary name-based virtual host).

+ How much older? + Please note that when we say older, we really do mean older. You are + very unlikely to encounter one of these browsers in use today. All + current versions of any browser send the Host header as + required for name-based virtual hosts. + +

There is a possible workaround with the ServerPath directive, albeit a slightly cumbersome one:

@@ -198,9 +216,11 @@ NameVirtualHost 111.22.33.44

<VirtualHost 111.22.33.44>
+ ServerName www.domain.tld
ServerPath /domain
DocumentRoot /web/domain
+
</VirtualHost>
-- 2.40.0