Bug 49705 - Per request DocumentRoot
Summary: Per request DocumentRoot
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal with 4 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk
: 49706 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-05 04:40 UTC by Ondrej Sury
Modified: 2012-02-26 17:07 UTC (History)
0 users



Attachments
Implementation of per request DocumentRoot (4.89 KB, patch)
2010-08-05 04:40 UTC, Ondrej Sury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Sury 2010-08-05 04:40:21 UTC
Created attachment 25843 [details]
Implementation of per request DocumentRoot

Attached patch implements per request DocumentRoot.

It keeps the DocumentRoot inside Core Module, but it copies it into each individual request_rec.

This should solve long standing issue with mod-vhost-alias and other virtual hosting modules (mod-vhost-ldap) having incorrect DocumentRoot (which is used in other places like PHP and others).

Attached patch also makes necessary changes to mod-vhost-alias.

There is another user of ap_document_root() -> mod_rewrite.  This will need more fixing in m-v-a if you use ${DOCUMENT_ROOT} in mod_rewrite.

r->document_root has to be rewritten before mod_rewrite call, then m-v-a has to return DECLINED, and after mod_rewrite call there's need to be another m-v-a hook which do the real work.
Comment 1 Ruediger Pluem 2010-08-05 06:39:01 UTC
*** Bug 49706 has been marked as a duplicate of this bug. ***
Comment 2 Stefan Fritsch 2011-06-05 21:39:06 UTC
Fixed in trunk in r1132494
Comment 3 Stefan Fritsch 2012-02-26 17:07:41 UTC
fixed in 2.4.1