httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damian Meyer <>
Subject Re: [users@httpd] combining mod_rewrite and mod_vhost_alias
Date Fri, 06 Feb 2004 01:47:12 GMT

Joshua Slive wrote:

>On Thu, 5 Feb 2004, Damian Meyer wrote:
>>However, when it comes to CGI scripts, there seems to be no way to use
>>suEXEC to wrap these to run as the actual user, not the nobody user.
>>I've looked at cgiwrap and mod_cgiwrap which seems to be part way
>>there.  However the DOCUMENT_ROOT is not correct.  So to my question: is
>>there any way to modify the DOCUMENT_ROOT variable within mod_rewrite in
>>httpd.conf?   I suspect the answer is no, but thought I would ask.
>You suspect correctly.  The answer is no.
>The main reason is that DOCUMENT_ROOT is not a variable that should be
>used.  It does not take into account Aliases, RewriteRules, etc, and
>therefore is unreliable.
>But I don't see why you need to use DOCUMENT_ROOT anyway.  I'm not a
>cgiwrap expert, but it doesn't really seem to be required.

cgiwrap works by either having the username to wrap the cgi passed as an 
argument on the extra path info, or by getting the user that owns the 
DOCUMENT_ROOT as the user to exec the cgi under.  Tied in with 
mod_cgiwrap that automates this and the second option, the user that 
owns the DOCUMENT_ROOT becomes important.  Unfortunately this clashes 
with the mod_rewrite way of doing dynamic virtual hosts.

It's time I think to dive under the hood of these and hack something, 
despite my very rusty C programming skills I think.

Just as an aside, Apache really needs an industrial strength dynamic 
virtual host module that deals with multiple server aliases and with 
wrapping cgis as the user.  If mod_vhost_alias had some rewrite 
capabilities or conditional rule selection, and a way of tying in with 
suEXEC, then that would be ideal.  I suspect a lot of large ISPs have 
internal solutions to these problems, although I can't find anything 
released back to the community that does it.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message