On Thu, Mar 07, 2002 at 08:23:35PM -0800, Sander van Zoest wrote:
> On Thu, Mar 07, 2002 at 02:25:56PM -0800, Greg Stein wrote:
> >
> > Modules shouldn't be worried about the document root. If you need to call
> > this function, then you should ask yourself "why". Modules should be more
> > concerned with r->uri and r->filename.

This also applies to CGIs. The DOCUMENT_ROOT environment variable is
a non-standard extension so it should be avoided.

> In the case of using a CGI with mod_vhost_alias it would be
> nice to be able to have the CGI have access to the virtual document root
> via ENV{DOCUMENT_ROOT}. Right now this doesn't seem possible because
> mod_vhost_alias does not have access to it and otherwise
> ap_add_cgi_vars(r) resets it if we set it via r->subprocess_env in
> mod_vhost_alias.

There are a number of other situations in which the document root setting
is irrelevant, such as normal aliases, mod_userdir, and mod_rewrite;
mod_vhost_alias just makes it more obvious that this is so.

The right fix for CGIs is to allow modules to participate more fully
in setting up environment variables, so that e.g. modules that do
URI->filename mapping can override the DOCUMENT_ROOT setting.

Tony.
-- 
f.a.n.finch <[EMAIL PROTECTED]>
FAEROES: SOUTHERLY VEERING WESTERLY, 4 OR 5 INCREASING 6 TO GALE 8, PERHAPS
SEVERE GALE 9 LATER. RAIN THEN WINTRY SHOWERS. MODERATE OR GOOD.

Reply via email to