Bug 29260 - new v-hosting features desired
Summary: new v-hosting features desired
Status: RESOLVED DUPLICATE of bug 40441
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_vhost_alias (show other bugs)
Version: 2.0.48
Hardware: PC FreeBSD
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2004-05-27 23:03 UTC by Adam Harrison
Modified: 2007-09-25 11:14 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Adam Harrison 2004-05-27 23:03:48 UTC
The base functionality of mod_vhost_alias for dynamic mass virtual hosting seems to work great, but 
there are a couple things that need to be changed to work with it.

First, I would like www.domain.com and domain.com to work off of the same directory. An easy way 
would be to have ServerAlias work with the %0, %1, etc variables. The same thing with logging. It would 
be nice to be able to to use %0 in specifying the path to the log ot the log name.

In the end I would like to be able to do something like this:

UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /web/hosts/%0/access_log vcommon
VirtualDocumentRoot /web/hosts/%0/htdocs
VirtualScriptAlias /web/hosts/%0/cgi-bin
ServerAlias www.%0

The weird thing is RewriteRules don't seem to work either.  Even something as simpe as

RewriteRule ^/web/hosts/www\.(.*) /web/hosts/$1 has no effect either before or after the 
VirtualDocumentRoot statement.

It would be nice if the mod_vhost_alias module worked more seemlessly with the other modules in 
Comment 1 Joshua Slive 2004-05-28 11:56:23 UTC
The log file suggestion is not feasible.  You should simply include the
servername in your logformat and split up the logs after-the-fact.

The domain-alias problem is usually solved by using symbolic links in the
filesystem or by using a RewriteRule to canonicalize the requests.

The RewriteRule that you include does not look valid to me.  It is matching
against a physical path, whereas it should be referring to a web path.  Can you
try with a properly-formed RewriteRule?
Comment 2 Joshua Slive 2007-09-25 11:14:19 UTC
Most of this is WONTFIX, but the stripping www thing is reported elsewhere.

*** This bug has been marked as a duplicate of 40441 ***