From: Rich Bowen Date: Fri, 27 Nov 2009 17:35:47 +0000 (+0000) Subject: Clarifying some of the phrasing, and removing some of the chattiness X-Git-Tag: 2.3.5~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5170f710da0a1f42ee393f4e5e1b561ac0b1dc4;p=apache Clarifying some of the phrasing, and removing some of the chattiness from the example itself. Will eventually remove duplication between this doc and the rewrite/vhosts.xml doc. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@884917 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/vhosts/mass.html.en b/docs/manual/vhosts/mass.html.en index df168b182d..51333c7073 100644 --- a/docs/manual/vhosts/mass.html.en +++ b/docs/manual/vhosts/mass.html.en @@ -53,34 +53,29 @@ <VirtualHost> sections that are substantially the same, for example:

-

-NameVirtualHost 111.22.33.44
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-1.com
- DocumentRoot /www/hosts/www.customer-1.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin
-
-</VirtualHost>
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-2.com
- DocumentRoot /www/hosts/www.customer-2.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin
-
-</VirtualHost>
-# blah blah blah
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-N.com
- DocumentRoot /www/hosts/www.customer-N.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin
-
+

+NameVirtualHost 111.22.33.44
+<VirtualHost 111.22.33.44>
+    ServerName                 www.customer-1.com
+    DocumentRoot        /www/hosts/www.customer-1.com/docs
+    ScriptAlias  /cgi-bin/  /www/hosts/www.customer-1.com/cgi-bin
+</VirtualHost>
+
+<VirtualHost 111.22.33.44>
+    ServerName                 www.customer-2.com
+    DocumentRoot        /www/hosts/www.customer-2.com/docs
+    ScriptAlias  /cgi-bin/  /www/hosts/www.customer-2.com/cgi-bin
 </VirtualHost>
-

-

The basic idea is to replace all of the static - <VirtualHost> configurations with a mechanism +<VirtualHost 111.22.33.44> + ServerName www.customer-N.com + DocumentRoot /www/hosts/www.customer-N.com/docs + ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin +</VirtualHost> +

+ +

We wish to replace these multiple + <VirtualHost> blocks with a mechanism that works them out dynamically. This has a number of advantages:

@@ -301,12 +296,12 @@ VirtualScriptAliasIP /www/hosts/%0/cgi-bin
mod_rewrite part work properly; the second half configures mod_rewrite to do the actual work.

-

There are a couple of especially tricky bits: by default, - mod_rewrite runs before other URI translation - modules (mod_alias etc.) - so if you wish to use these modules, mod_rewrite must be configured to accommodate - them. Also, some magic is required to do a - per-dynamic-virtual-host equivalent of - ScriptAlias.

+

Because mod_rewrite runs before other URI translation + modules (e.g., mod_alias), mod_rewrite must + be told to explicitly ignore any URLs that would have been handled + by those modules. And, because these rules would otherwise bypass + any ScriptAlias directives, we must have + mod_rewrite explicitly enact those mappings.

# get the server name from the Host: header
@@ -324,8 +319,6 @@ CustomLog logs/access_log vcommon
</Directory>

-# now for the hard bit
-
RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
@@ -342,8 +335,6 @@ RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1
## and now deal with CGIs - we have to force a handler
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [H=cgi-script]
-
-# that's it!

top
diff --git a/docs/manual/vhosts/mass.xml b/docs/manual/vhosts/mass.xml index c9b7f4a000..c9a370ac10 100644 --- a/docs/manual/vhosts/mass.xml +++ b/docs/manual/vhosts/mass.xml @@ -40,33 +40,30 @@ substantially the same, for example:

-NameVirtualHost 111.22.33.44
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-1.com
- DocumentRoot /www/hosts/www.customer-1.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin
-
-</VirtualHost>
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-2.com
- DocumentRoot /www/hosts/www.customer-2.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin
-
-</VirtualHost>
-# blah blah blah
-<VirtualHost 111.22.33.44>
- - ServerName www.customer-N.com
- DocumentRoot /www/hosts/www.customer-N.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin
-
+
+NameVirtualHost 111.22.33.44
+<VirtualHost 111.22.33.44>
+    ServerName                 www.customer-1.com
+    DocumentRoot        /www/hosts/www.customer-1.com/docs
+    ScriptAlias  /cgi-bin/  /www/hosts/www.customer-1.com/cgi-bin
+</VirtualHost>
+
+<VirtualHost 111.22.33.44>
+    ServerName                 www.customer-2.com
+    DocumentRoot        /www/hosts/www.customer-2.com/docs
+    ScriptAlias  /cgi-bin/  /www/hosts/www.customer-2.com/cgi-bin
 </VirtualHost>
+
+<VirtualHost 111.22.33.44>
+    ServerName                 www.customer-N.com
+    DocumentRoot        /www/hosts/www.customer-N.com/docs
+    ScriptAlias  /cgi-bin/  /www/hosts/www.customer-N.com/cgi-bin
+</VirtualHost>
+
-

The basic idea is to replace all of the static - <VirtualHost> configurations with a mechanism +

We wish to replace these multiple + <VirtualHost> blocks with a mechanism that works them out dynamically. This has a number of advantages:

@@ -289,12 +286,12 @@ VirtualScriptAliasIP /www/hosts/%0/cgi-bin
mod_rewrite part work properly; the second half configures mod_rewrite to do the actual work.

-

There are a couple of especially tricky bits: by default, - mod_rewrite runs before other URI translation - modules (mod_alias etc.) - so if you wish to use these modules, mod_rewrite must be configured to accommodate - them. Also, some magic is required to do a - per-dynamic-virtual-host equivalent of - ScriptAlias.

+

Because mod_rewrite runs before other URI translation + modules (e.g., mod_alias), mod_rewrite must + be told to explicitly ignore any URLs that would have been handled + by those modules. And, because these rules would otherwise bypass + any ScriptAlias directives, we must have + mod_rewrite explicitly enact those mappings.

# get the server name from the Host: header
@@ -312,8 +309,6 @@ CustomLog logs/access_log vcommon
</Directory>

-# now for the hard bit
-
RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
@@ -330,8 +325,6 @@ RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1
## and now deal with CGIs - we have to force a handler
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [H=cgi-script]
-
-# that's it!