From: Tony Finch http://www.example.isp.com/directory/file.html
will be satisfied by the file
-/usr/local/apache/isp.com/e/x/a/example/directory/file.html
.
+/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:
@@ -123,16 +123,29 @@ For IP-based virtual hosting you might use the following in your
configuration file:
UseCanonicalName DNS
- VirtualDocumentRootIP /usr/local/apache/vhost/%1/%2/%3/%4/docs
- VirtualScriptAliasIP /usr/local/apache/vhost/%1/%2/%3/%4/cgi-bin
+ 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/10/20/30/40/docs/directory/file.html
if
+/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/10/20/30/40/cgi-bin/script.pl
.
+/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
.