From 5342738ffc9773e209ea984a2b05e12335bc2af2 Mon Sep 17 00:00:00 2001
From: Rich Bowen This extract from Overview
Dynamic Virtual Hosts with
mod_vhost_alias
A Virtually Hosted Homepages System
Simplified Dynamic Virtual Hosts
Using Multiple Virtual
Hosting Systems on the Same Server
More Efficient IP-Based Virtual Hosting
mod_vhost_alias
or
- mod_rewrite
), which has a different way of doing
+ module (either mod_vhost_alias
or
+ mod_rewrite
), which has a different way of doing
the mapping. Neither of these modules is responsible for
setting the DOCUMENT_ROOT
environment variable so
if any CGIs or SSI documents make use of it, they will get a
@@ -153,7 +153,7 @@ mod_vhost_alias
httpd.conf
implements the
virtual host arrangement outlined in the Motivation section above
- using mod_vhost_alias
.mod_vhost_alias
.
# get the server name from the Host: header
@@ -180,21 +180,24 @@ examples.
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
use in the filename so that, for example, the documents for
www.user.isp.com
are found in
- /home/user/
. It uses a single cgi-bin
+ /home/user/www
. It uses a single cgi-bin
directory instead of one per virtual host.
-# all the preliminary stuff is the same as above, then
+UseCanonicalName Off
+
+LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog logs/access_log vcommon
# include part of the server name in the filenames
-VirtualDocumentRoot /www/hosts/%2/docs
+VirtualDocumentRoot /home/%2/www
# single cgi-bin directory
ScriptAlias /cgi-bin/ /www/std-cgi/
@@ -214,8 +217,9 @@ ScriptAlias /cgi-bin/ /www/std-cgi/
scope of the various virtual hosting configurations. For
example, you could have one IP address for general customers' homepages,
and another for commercial customers, with the following setup.
- This can, of course, be combined with conventional
- <VirtualHost>
configuration sections.
<VirtualHost>
configuration sections, as shown
+ below.
UseCanonicalName Off
@@ -265,7 +269,7 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
ServerName
directive, the reverse
DNS of the relevant IP will be used instead.
If this is not the server name you
- wish to use, a bogus entry (ServerName
+ wish to use, a bogus entry (eg.
ServerName
none.example.com
) can be added to get around this
behaviour.
mod_vhost_alias
or
- mod_rewrite
), which has a different way of doing
+ module (either DOCUMENT_ROOT
environment variable so
if any CGIs or SSI documents make use of it, they will get a
@@ -148,7 +148,7 @@ mod_vhost_alias
This extract from httpd.conf
implements the
virtual host arrangement outlined in the Motivation section above
- using mod_vhost_alias
.
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
use in the filename so that, for example, the documents for
www.user.isp.com
are found in
- /home/user/
. It uses a single cgi-bin
+ /home/user/www
. It uses a single cgi-bin
directory instead of one per virtual host.
<VirtualHost>
configuration sections.
+ This can be combined with conventional
+ <VirtualHost>
configuration sections, as shown
+ below.
ServerName
+ wish to use, a bogus entry (eg. ServerName
none.example.com
) can be added to get around this
behaviour.
--
2.40.0