From 6be5a9e6371cba71091be0a7cf24e9cf2030b588 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Wed, 7 Apr 2010 12:22:52 +0000 Subject: [PATCH] Comparnisions to Apache 1.3 aren't terribly helpful. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@931520 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/vhosts/details.html.en | 55 ++++++++---------------------- docs/manual/vhosts/details.xml | 53 ++++++++-------------------- docs/manual/vhosts/mass.html.en | 12 ++++--- docs/manual/vhosts/mass.xml | 12 ++++--- 4 files changed, 43 insertions(+), 89 deletions(-) diff --git a/docs/manual/vhosts/details.html.en b/docs/manual/vhosts/details.html.en index 0ad71c2747..e496b7c8c0 100644 --- a/docs/manual/vhosts/details.html.en +++ b/docs/manual/vhosts/details.html.en @@ -25,26 +25,22 @@ -

The virtual host code was completely rewritten in - Apache 1.3. This document attempts to explain - exactly what Apache does when deciding what virtual host to - serve a hit from. With the help of the new - NameVirtualHost - directive virtual host configuration should be a lot easier and - safer than with versions prior to 1.3.

+

This document attempts to explain + exactly what Apache HTTP Server does when deciding what virtual host to + serve a request from.

If you just want to make it work without understanding how, here are some examples.

-
diff --git a/docs/manual/vhosts/details.xml b/docs/manual/vhosts/details.xml index 954d39b03e..b4b7691ecd 100644 --- a/docs/manual/vhosts/details.xml +++ b/docs/manual/vhosts/details.xml @@ -26,13 +26,9 @@ -

The virtual host code was completely rewritten in - Apache 1.3. This document attempts to explain - exactly what Apache does when deciding what virtual host to - serve a hit from. With the help of the new - NameVirtualHost - directive virtual host configuration should be a lot easier and - safer than with versions prior to 1.3.

+

This document attempts to explain + exactly what Apache HTTP Server does when deciding what virtual host to + serve a request from.

If you just want to make it work without understanding how, here are some @@ -40,7 +36,7 @@

-
Config File Parsing +
Configuration File Parsing

There is a main_server which consists of all the definitions appearing outside of @@ -49,17 +45,15 @@ VirtualHost sections.

-

The directives - ServerName and - ServerPath - can appear anywhere within the definition of a server. However, +

The + ServerName directive + may appear anywhere within the definition of a server. However, each appearance overrides the previous appearance (within that server).

The main_server has no default - ServerPath, or ServerAlias. The - default ServerName is deduced from the server's IP - address.

+ ServerAlias. The default ServerName, + if not specified, is deduced from the server's IP address.

Port numbers specified in the VirtualHost directive do not influence what port numbers Apache will listen on, they only discriminate between @@ -276,15 +270,10 @@

If the client submitted a HTTP/1.0 request without Host: header field we don't know to what server - the client tried to connect and any existing - ServerPath is matched against the URI from the - request. The first matching path on the list is used and the - request is served from that vhost.

- -

If no matching vhost could be found the request is served - from the first vhost with a matching port number that is on the - list for the IP to which the client connected (as already - mentioned before).

+ the client tried to connect to. In this case, the first virtual host + (that is, the one listed first in the server configuration file) for + the IP address and port to which the client connected, is + used to serve this request.

@@ -322,7 +311,7 @@ corresponding address set which must be defined with a NameVirtualHost directive. -
  • ServerAlias and ServerPath +
  • ServerAlias checks are never performed for an IP-based vhost.
  • The order of name-/IP-based, the _default_ @@ -337,13 +326,6 @@ matching process. Apache always uses the real port to which the client sent the request.
  • -
  • If a ServerPath directive exists which is a - prefix of another ServerPath directive that - appears later in the configuration file, then the former will - always be matched and the latter will never be matched. (That - is assuming that no Host: header field was - available to disambiguate the two.)
  • -
  • If two IP-based vhosts have an address in common, the vhost appearing first in the config file is always matched. Such a thing might happen inadvertently. The server will give @@ -409,13 +391,6 @@
  • Group corresponding NameVirtualHost and VirtualHost definitions in your configuration to ensure better readability.
  • - -
  • Avoid ServerPaths which are prefixes of - other ServerPaths. If you cannot avoid this then - you have to ensure that the longer (more specific) prefix - vhost appears earlier in the configuration file than the - shorter (less specific) prefix (i.e., "ServerPath - /abc" should appear after "ServerPath /abc/def").
  • diff --git a/docs/manual/vhosts/mass.html.en b/docs/manual/vhosts/mass.html.en index 529d92d261..fa247a11de 100644 --- a/docs/manual/vhosts/mass.html.en +++ b/docs/manual/vhosts/mass.html.en @@ -109,7 +109,7 @@ NameVirtualHost 111.22.33.44 pathname of the file that is used to satisfy the request. This can be most easily done by using
    mod_vhost_alias with Apache httpd. Alternatively, - mod_rewrite can + mod_rewrite can be used.

    Both of these modules are disabled by default; you must enable one of them when configuring and building Apache httpd if you want to @@ -134,7 +134,7 @@ NameVirtualHost 111.22.33.44 ServerName is used instead.

    The other thing to determine is the document root (configured - with DocumentRoot and available to CGIs via the + with DocumentRoot and available to CGI scripts via the DOCUMENT_ROOT environment variable). In a normal configuration, this is used by the core module when mapping URIs to filenames, but when the server is configured to @@ -173,7 +173,9 @@ VirtualScriptAlias /www/hosts/%0/cgi-bin hosting solution by just turning UseCanonicalName Off into UseCanonicalName DNS. The server name that is inserted into the filename is then derived from - the IP address of the virtual host.

    + the IP address of the virtual host. The variable %0 + references the requested servername, as indicated in the + Host: header.

    See the mod_vhost_alias documentation for more usage examples.

    @@ -183,8 +185,8 @@ examples.

    Simplified Dynamic Virtual Hosts

    This is an adjustment of the above system, tailored for an - ISP's homepages server. Using a slightly more complicated - configuration, we can select substrings of the server name to + ISP's web hosting server. Using %2, + we can select substrings of the server name to use in the filename so that, for example, the documents for www.user.isp.com are found in /home/user/www. It uses a single cgi-bin diff --git a/docs/manual/vhosts/mass.xml b/docs/manual/vhosts/mass.xml index 29d8cd4f16..d86071a127 100644 --- a/docs/manual/vhosts/mass.xml +++ b/docs/manual/vhosts/mass.xml @@ -102,7 +102,7 @@ NameVirtualHost 111.22.33.44 pathname of the file that is used to satisfy the request. This can be most easily done by using mod_vhost_alias with Apache httpd. Alternatively, - mod_rewrite can + mod_rewrite can be used.

    Both of these modules are disabled by default; you must enable one of them when configuring and building Apache httpd if you want to @@ -128,7 +128,7 @@ NameVirtualHost 111.22.33.44 ServerName is used instead.

    The other thing to determine is the document root (configured - with DocumentRoot and available to CGIs via the + with DocumentRoot and available to CGI scripts via the DOCUMENT_ROOT environment variable). In a normal configuration, this is used by the core module when mapping URIs to filenames, but when the server is configured to @@ -168,7 +168,9 @@ VirtualScriptAlias /www/hosts/%0/cgi-bin hosting solution by just turning UseCanonicalName Off into UseCanonicalName DNS. The server name that is inserted into the filename is then derived from - the IP address of the virtual host.

    + the IP address of the virtual host. The variable %0 + references the requested servername, as indicated in the + Host: header.

    See the mod_vhost_alias documentation for more usage examples.

    @@ -178,8 +180,8 @@ examples.

    Simplified Dynamic Virtual Hosts

    This is an adjustment of the above system, tailored for an - ISP's homepages server. Using a slightly more complicated - configuration, we can select substrings of the server name to + ISP's web hosting server. Using %2, + we can select substrings of the server name to use in the filename so that, for example, the documents for www.user.isp.com are found in /home/user/www. It uses a single cgi-bin -- 2.50.1