You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ondřej Surý <on...@sury.org> on 2010/10/27 09:57:58 UTC

Re: Per request DocumentRoot

Hi,

I would like to raise this issue again.  The proposed solution by
Anders Kaseorg:

> FWIW, when I ran into this problem in mod-vhost-ldap, I fixed it by
> making a copy of the entire server_rec structure in the request pool.

doesn't really work with mod_rewrite, because mod_rewrite contains this code:

    if (conf->server != r->server) {
        return DECLINED;
    }

in the hook_uri2file (translate_name hook).

which prevents mod_rewrite to run if server_rec structure is modified
before mod_rewrite. However all virtual document root modules need to
be run before mod_rewrite for -f and -d to work.

As far as I can see, the moving the document_root to request_rec is
only viable solution in the long run for virtualization modules.

Ondrej

On Thu, Aug 5, 2010 at 11:53, Ondřej Surý <on...@sury.org> wrote:
> On Thu, Aug 5, 2010 at 10:25, William A. Rowe Jr. <wr...@rowe-clan.net> wrote:
>> On 8/5/2010 3:22 AM, Ondřej Surý wrote:
>>> William,
>>>
>>> On Thu, Aug 5, 2010 at 10:18, William A. Rowe Jr. <wr...@rowe-clan.net> wrote:
>>>> On 8/5/2010 3:12 AM, Ondřej Surý wrote:
>>>>> I have a question how to proceed. Is there really no interest in doing
>>>>> this? (And fixing mod-vhost-alias as well.)
>>>>>
>>>>> Or should I fill the bug and attach the patch? Or ...?
>>>>
>>>> Please don't confuse ignoring your patch with lack of interest.  Everyone
>>>> here is a volunteer and dedicates the cycles they have free to attacking
>>>> the most pressing issue they see at the time.
>>>
>>> Sorry if that offended you or anybody else. I didn't ment to sound
>>> harsh as I was just merely asking what to do now.
>>
>> You didn't and I didn't mean to sound irritated, either, just trying to frame
>> what happens on this particular list for your info.
>
> Ok :).
>
>> Many 'nice to have' things for Apache 2.4 are ignored as more critical issues
>> in 2.2 are addressed, but with rising interest in frequent alpha/betas, we can
>> all hope that improves :)
>
> I've filled this under #49705
>
> https://issues.apache.org/bugzilla/show_bug.cgi?id=49705
>
> Ondrej
> --
> Ondřej Surý <on...@sury.org>
>



-- 
Ondřej Surý <on...@sury.org>

Re: Per request DocumentRoot

Posted by Graham Leggett <mi...@sharp.fm>.
On 06 Jun 2011, at 10:59 PM, Stefan Fritsch wrote:

> These should not be changed for now. The core only translates relative
> to the "real" document root. Everything else is done by modules.
>
> If we ever allow to set the DocumentRoot inside <Location> blocks,
> this may need to be re-evaluated.

That might be nice to have, you could avoid having to Alias everything.

Regards,
Graham
--


Re: Per request DocumentRoot

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Monday 06 June 2011, Ondřej Surý wrote:
> Looks good to me, although I think you might have missed few lines
> where conf->ap_document_root is referenced directly in
> core.c:ap_core_translate(request_rec *r):
 
> But I don't understand the apache internals so well to tell whether
> it's not a false positive.

These should not be changed for now. The core only translates relative 
to the "real" document root. Everything else is done by modules.

If we ever allow to set the DocumentRoot inside <Location> blocks, 
this may need to be re-evaluated.

Re: Per request DocumentRoot

Posted by Ondřej Surý <on...@sury.org>.
On Sun, Jun 5, 2011 at 23:44, Stefan Fritsch <sf...@sfritsch.de> wrote:
> On Tuesday 17 May 2011, Ondřej Surý wrote:
>> this is the semi-annual ping to check whether I can find enough
>> support to get per request r->document_root implemented in 2.3.x.
>
> Something like that is now implemented in trunk in
>
> http://svn.apache.org/viewvc?view=revision&revision=1132494
>
> Comments welcome.

Looks good to me, although I think you might have missed few lines
where conf->ap_document_root is referenced directly in
core.c:ap_core_translate(request_rec *r):

https://issues.apache.org/bugzilla/attachment.cgi?id=25843&action=diff#server/core.c_sec2

https://issues.apache.org/bugzilla/attachment.cgi?id=25843&action=diff#server/core.c_sec3

But I don't understand the apache internals so well to tell whether
it's not a false positive.

O.
-- 
Ondřej Surý <on...@sury.org>

Re: Per request DocumentRoot

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Tuesday 17 May 2011, Ondřej Surý wrote:
> this is the semi-annual ping to check whether I can find enough
> support to get per request r->document_root implemented in 2.3.x.

Something like that is now implemented in trunk in

http://svn.apache.org/viewvc?view=revision&revision=1132494

Comments welcome.

Cheers,
Stefan

Re: Per request DocumentRoot

Posted by Ondřej Surý <on...@sury.org>.
Hi,

this is the semi-annual ping to check whether I can find enough
support to get per request r->document_root implemented in 2.3.x.

The patch is attached at
https://issues.apache.org/bugzilla/show_bug.cgi?id=49705

And I am willing to update it to current 2.3.x if there is enough
interest. Or implement it in some another way. Or <something>. It is
really a blocker if users of my mod-vhost-ldap (and any other vhost
modules) want to rewrite document root (for PHP f.e.).

O.

On Wed, Oct 27, 2010 at 09:57, Ondřej Surý <on...@sury.org> wrote:
> Hi,
>
> I would like to raise this issue again.  The proposed solution by
> Anders Kaseorg:
>
>> FWIW, when I ran into this problem in mod-vhost-ldap, I fixed it by
>> making a copy of the entire server_rec structure in the request pool.
>
> doesn't really work with mod_rewrite, because mod_rewrite contains this code:
>
>    if (conf->server != r->server) {
>        return DECLINED;
>    }
>
> in the hook_uri2file (translate_name hook).
>
> which prevents mod_rewrite to run if server_rec structure is modified
> before mod_rewrite. However all virtual document root modules need to
> be run before mod_rewrite for -f and -d to work.
>
> As far as I can see, the moving the document_root to request_rec is
> only viable solution in the long run for virtualization modules.
>
> Ondrej
>
> On Thu, Aug 5, 2010 at 11:53, Ondřej Surý <on...@sury.org> wrote:
>> On Thu, Aug 5, 2010 at 10:25, William A. Rowe Jr. <wr...@rowe-clan.net> wrote:
>>> On 8/5/2010 3:22 AM, Ondřej Surý wrote:
>>>> William,
>>>>
>>>> On Thu, Aug 5, 2010 at 10:18, William A. Rowe Jr. <wr...@rowe-clan.net> wrote:
>>>>> On 8/5/2010 3:12 AM, Ondřej Surý wrote:
>>>>>> I have a question how to proceed. Is there really no interest in doing
>>>>>> this? (And fixing mod-vhost-alias as well.)
>>>>>>
>>>>>> Or should I fill the bug and attach the patch? Or ...?
>>>>>
>>>>> Please don't confuse ignoring your patch with lack of interest.  Everyone
>>>>> here is a volunteer and dedicates the cycles they have free to attacking
>>>>> the most pressing issue they see at the time.
>>>>
>>>> Sorry if that offended you or anybody else. I didn't ment to sound
>>>> harsh as I was just merely asking what to do now.
>>>
>>> You didn't and I didn't mean to sound irritated, either, just trying to frame
>>> what happens on this particular list for your info.
>>
>> Ok :).
>>
>>> Many 'nice to have' things for Apache 2.4 are ignored as more critical issues
>>> in 2.2 are addressed, but with rising interest in frequent alpha/betas, we can
>>> all hope that improves :)
>>
>> I've filled this under #49705
>>
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=49705
>>
>> Ondrej
>> --
>> Ondřej Surý <on...@sury.org>
>>
>
>
>
> --
> Ondřej Surý <on...@sury.org>
>



-- 
Ondřej Surý <on...@sury.org>