19.38. mod_vhost_aliasThe mod_vhost_alias supports the dynamic configuration of document roots and script directories for virtual hosts. This functionality is useful when a server handles a large number of virtual hosts, usually by varying the subdomain sections of the hostname. Virtual hosts configured under the directives of this module are expected to share the same configuration since they won't have their own <Virtual Directory> sections. The name of the virtual host is determined by the Host: header in the client request. (This requires UseCanonicalName off.) The IP address is the address assigned to the particular virtual host. The directives of this module use either the host name or IP address and interpolate it to locate unique document and script paths for each host. The interpolated path parameter for each directive uses a printf-like format string to refashion parts of the virtual hostname or address into a directory. A %-sign followed by a short format specifier represent sections of the name in the interpolated directory. Each word between the dots in a name or address is a section numbered from left to right, starting with one. The whole name is represented by 0 (%0). For example:
Additionally, %p represents the port number. The settings of this module will be overridden by any mod_alias and mod_userdir settings on the same host names.
VirtualDocumentRoot interpolated_path [server config, within <VirtualHost>] Sets the root document directories for matching virtual hostnames.
VirtualDocumentRootIP interpolated_path [server config, within <VirtualHost>] Sets the root document directories for virtual hosts with matching IP addresses.
VirtualScriptAlias interpolated_path [server config, within <VirtualHost>] Sets the location of CGI directories for matching virtual hostnames.
VirtualScriptAliasIP interpolated_path [server config, within <VirtualHost>] Sets the location of CGI directories for virtual hosts with matching IP addresses. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|