From 90ae2bd2be3f99c01172179d513030fa2e2b1bb9 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Mon, 4 Mar 2002 02:38:42 +0000 Subject: [PATCH] Conversion to xml git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93689 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_vhost_alias.xml | 287 ++++++++++++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 docs/manual/mod/mod_vhost_alias.xml diff --git a/docs/manual/mod/mod_vhost_alias.xml b/docs/manual/mod/mod_vhost_alias.xml new file mode 100644 index 0000000000..d10d21cb39 --- /dev/null +++ b/docs/manual/mod/mod_vhost_alias.xml @@ -0,0 +1,287 @@ + + + + +mod_vhost_alias +Extension +vhost_alias_module +mod_vhost_alias.c +Available in Apache 1.3.7 and later. + +This module provides support for dynamically configured mass virtual +hosting. + + + +

This module creates dynamically configured virtual hosts, by + allowing the IP address and/or the Host: header of + the HTTP request to be used as part of the pathname to + determine what files to serve. This allows for easy use of a + huge number of virtual hosts with similar configurations.

+ + See also: UseCanonicalName. + +
+ +
+ Directory Name Interpolation + +

All the directives in this module interpolate a string into + a pathname. The interpolated string (henceforth called the + "name") may be either the server name (see the UseCanonicalName + directive for details on how this is determined) or the IP + address of the virtual host on the server in dotted-quad + format. The interpolation is controlled by specifiers inspired + by printf which have a number of formats:

+ + + + + + + + + + + + +
%%insert a %
%pinsert the port number of the virtual host
%N.Minsert (part of) the name
+ +

N and M are used to specify + substrings of the name. N selects from the + dot-separated components of the name, and M + selects characters within whatever N has selected. + M is optional and defaults to zero if it isn't + present; the dot must be present if and only if M + is present. The interpretation is as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
0the whole name
1the first part
2the second part
-1the last part
-2the penultimate part
2+the second and all subsequent parts
-2+the penultimate and all preceding parts
1+ and -1+the same as 0
+ +

If N or M is greater than the number + of parts available a single underscore is interpolated.

+ +
+ +
+ Examples + +

For simple name-based virtual hosts you might use the + following directives in your server configuration file:

+ + + UseCanonicalName Off
+ VirtualDocumentRoot /usr/local/apache/vhosts/%0 +
+ +

A request for + http://www.example.com/directory/file.html will be + satisfied by the file + /usr/local/apache/vhosts/www.example.com/directory/file.html. +

+ +

For a very large number of virtual hosts it is a good idea + to arrange the files to reduce the size of the + vhosts directory. To do this you might use the + following in your configuration file:

+ + + UseCanonicalName Off
+ VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2 +
+ +

A request for + http://www.example.isp.com/directory/file.html + will be satisfied by the file + /usr/local/apache/vhosts/isp.com/e/x/a/example/directory/file.html.

+ +

A more even spread of files can be achieved by hashing from the + end of the name, for example:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2 + + +

The example request would come from + /usr/local/apache/vhosts/isp.com/e/l/p/example/directory/file.html.

+ +

Alternatively you might use:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+ + + +

The example request would come from + /usr/local/apache/vhosts/isp.com/e/x/a/mple/directory/file.html.

+ +

For IP-based virtual hosting you might use the following in + your configuration file:

+ + + UseCanonicalName DNS
+ VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs
+ VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin +
+ +

A request for + http://www.example.isp.com/directory/file.html + would be satisfied by the file + /usr/local/apache/vhosts/10/20/30/40/docs/directory/file.html + if the IP address of www.example.com were + 10.20.30.40. A request for + http://www.example.isp.com/cgi-bin/script.pl would + be satisfied by executing the program + /usr/local/apache/vhosts/10/20/30/40/cgi-bin/script.pl.

+ +

If you want to include the . character in a + VirtualDocumentRoot directive, but it clashes with + a % directive, you can work around the problem in + the following way:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%2.0.%3.0 + + +

A request for + http://www.example.isp.com/directory/file.html + will be satisfied by the file + /usr/local/apache/vhosts/example.isp/directory/file.html.

+ +

The LogFormat + directives %V and %A are useful + in conjunction with this module.

+
+ + +VirtualDocumentRoot +VirtualDocumentRoot interpolated-directory +none + +server config +virtual host + + +VirtualDocumentRoot is only available in 1.3.7 and +later. +Dynamically configure the location of the document root +for a given virtual host. + + + +

The VirtualDocumentRoot directive allows you to + determine where Apache will find your documents based on the + value of the server name. The result of expanding + interpolated-directory is used as the root of the + document tree in a similar manner to the DocumentRoot directive's argument. + If interpolated-directory is none then + VirtaulDocumentRoot is turned off. This directive + cannot be used in the same context as + VirtualDocumentRootIP.

+ +
+
+ + +VirtualDocumentRootIP +VirtualDocumentRootIP interpolated-directory +none + +server config +virtual host + + +VirtualDocumentRootIP is only available in 1.3.7 +and later. +Dynamically configure the location of the document root +for a given virtual host + + + +

The VirtualDocumentRootIP directive is like the + VirtualDocumentRoot + directive, except that it uses the IP address of the server end + of the connection instead of the server name.

+
+
+ + +VirtualScriptAlias +VirtualScriptAlias interpolated-directory +none + +server config +virtual host + + +VirtualScriptAlias is only available in 1.3.7 +and later. +Dynamically configure the location of the CGI directory for +a given virtual host. + + + +

The VirtualScriptAlias directive allows you to + determine where Apache will find CGI scripts in a similar + manner to VirtualDocumentRoot + does for other documents. It matches requests for URIs starting + /cgi-bin/, much like ScriptAlias + /cgi-bin/ would.

+ +
+
+ + +VirtualScriptAliasIP +VirtualScriptAliasIP interpolated-directory +none + +server config +virtual host + + +VirtualScriptAliasIP is only available in 1.3.7 +and later. +Dynamically configure the location of the cgi directory for +a given virtual host. + + + +

The VirtualScriptAliasIP directive is like the + VirtualScriptAlias + directive, except that it uses the IP address of the server end + of the connection instead of the server name.

+ +
+ +
+
+ -- 2.40.0