httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45524] New: Specifying multiple vhost aliases
Date Fri, 01 Aug 2008 17:50:27 GMT

           Summary: Specifying multiple vhost aliases
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: mod_vhost_alias

Per server configuration only one VirtualDocumentRoot setting is permitted or
used as far as I could tell from the mod_vhost_alias.c code and the
documentation provided.

This means theoretical configurations such as

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

may not be possible, or at least difficult to setup correctly. What really
seems to happen is that the second call to VDR will overwrite the first call.

The above configuration could probably be solved if VDR worked within Directory
blocks, and VDR allowed relative paths.

<Directory /usr/local/apache/vhosts/>
VirtualDocumentRoot %2.0.%3.0

<Directory /usr/local/apache/backwards/>
VirtualDocumentRoot %3.0.%2.0

Here's what I've patched into the apache source:

AddVirtualDocumentRoot /home/www/%0/www
AddVirtualDocumentRoot /home/www/%-2.0.%-1/%-3+/

The mappings are saved in a list, and each one is tested in the order it was
given until a match is found.

This can easily be extrapolated to provide a fall-back solution in case none of
the mappings match. Simply make the last VDR guaranteed to match.

My apache code is hackish at best. As a result I am not including the patch
just yet. I wanted to post this now that I've got it working and to let those
who may be interested know that it is on the way. I'll probably upload the
patch tonight or tomorrow.

Also I want to ensure that it integrates well with the DOCUMENT_ROOT patch.

Any questions, comments, suggestions please contact me. Send flames and insults
to /dev/null.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message