From c4b44526cdad208f2a1434e4fce4753127ee0be2 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Sun, 4 Apr 2010 01:37:37 +0000 Subject: [PATCH] I'm reluctant to keep telling people about the ServerPath directive, much less encouraging them to use it in a document on name-based vhosts. It causes confusion, and hasn't been necessary for years. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@930608 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/vhosts/name-based.html.en | 76 +++------------------------ docs/manual/vhosts/name-based.xml | 73 ++----------------------- 2 files changed, 10 insertions(+), 139 deletions(-) diff --git a/docs/manual/vhosts/name-based.html.en b/docs/manual/vhosts/name-based.html.en index dd051985bd..6a33bad273 100644 --- a/docs/manual/vhosts/name-based.html.en +++ b/docs/manual/vhosts/name-based.html.en @@ -30,8 +30,7 @@

See also

+

See also

top

Name-based vs. IP-based Virtual Hosts

@@ -46,22 +45,14 @@

Name-based virtual hosting is usually simpler, since you need only configure your DNS server to map each hostname to the correct IP address and then configure the Apache HTTP Server to recognize - the different hostnames. Name-based virtual hosting also eases - the demand for scarce IP addresses. Therefore you should use + the different hostnames. Name-based virtual hosting also eases + the demand for scarce IP addresses. Therefore you should use name-based virtual hosting unless there is a specific reason to - choose IP-based virtual hosting. Some reasons why you might consider + choose IP-based virtual hosting. Some reasons why you might consider using IP-based virtual hosting:

Available Languages:  de  | diff --git a/docs/manual/vhosts/name-based.xml b/docs/manual/vhosts/name-based.xml index b6918a3bc5..e3453b0722 100644 --- a/docs/manual/vhosts/name-based.xml +++ b/docs/manual/vhosts/name-based.xml @@ -32,7 +32,6 @@ An In-Depth Discussion of Virtual Host Matching Dynamically configured mass virtual hosting Virtual Host examples for common setups -ServerPath configuration example

Name-based vs. IP-based Virtual Hosts @@ -46,22 +45,14 @@

Name-based virtual hosting is usually simpler, since you need only configure your DNS server to map each hostname to the correct IP address and then configure the Apache HTTP Server to recognize - the different hostnames. Name-based virtual hosting also eases - the demand for scarce IP addresses. Therefore you should use + the different hostnames. Name-based virtual hosting also eases + the demand for scarce IP addresses. Therefore you should use name-based virtual hosting unless there is a specific reason to - choose IP-based virtual hosting. Some reasons why you might consider + choose IP-based virtual hosting. Some reasons why you might consider using IP-based virtual hosting:

    -
  • Some ancient clients are not compatible with name-based virtual - hosting. For name-based virtual hosting to work, the client must send - the HTTP Host header. This is required by HTTP/1.1, and is - implemented by all modern HTTP/1.0 browsers as an extension. If you - need to support obsolete clients and still use name-based virtual - hosting, a possible technique is discussed at the end of this - document.
  • - -
  • Name-based virtual hosting cannot be used with SSL secure servers +
  • Name-based virtual hosting cannot be used with SSL secure servers because of the nature of the SSL protocol.
  • Some operating systems and network equipment implement bandwidth @@ -83,7 +74,6 @@ NameVirtualHost ServerAlias ServerName - ServerPath VirtualHost @@ -211,59 +201,4 @@
-
Compatibility with Older Browsers - -

As mentioned earlier, there are some clients - who do not send the required data for the name-based virtual - hosts to work properly. These clients will always be sent the - 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:

- -

Example configuration:

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

What does this mean? It means that a request for any URI - beginning with "/domain" will be served from the - virtual host www.domain.tld. This means that the - pages can be accessed as http://www.domain.tld/domain/ - for all clients, although clients sending a Host: header - can also access it as http://www.domain.tld/.

- -

In order to make this work, put a link on your primary - virtual host's page to - http://www.domain.tld/domain/. Then, in the virtual - host's pages, be sure to use either purely relative links - (e.g., "file.html" or - "../icons/image.gif") or links containing the - prefacing /domain/ (e.g., - "http://www.domain.tld/domain/misc/file.html" or - "/domain/misc/file.html").

- -

This requires a bit of discipline, but adherence to these - guidelines will, for the most part, ensure that your pages will - work with all browsers, new and old.

- -
-- 2.40.0