httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: How to change ap_document_root variable from a apache2 module ?
Date Fri, 31 Dec 2004 05:08:47 GMT
On Thu, 30 Dec 2004, Paul Querna wrote:

> > Whether it is against the design or not, it is a useful thing to be able
> > to do.  And I fully realize that my module can do whatever it wants, but
> > other modules won't know about it unless I modify them.
> I agree this could be a useful 'feature'.

Not sure what "this" you have in mind here.  A change to the semantics
of document root will break things.  Do you mean you think it would be
useful to introduce another call - e.g. ap_request_root to get a
per-request root path independent of r->filename ?

>	  I believe in a new API for
> configuration, this should be taken into consideration. However, the
> current hack of overwriting the values of a CORE config struct is
> completely bogus.

Indeed, it'll break any module that uses it correctly.

> > This can be done quite safely in Apache1, by the way.
> I don't believe it can. Code?

Well, you can change the env var DOCUMENT_ROOT, as that's a per-request
thing.  But that's a grotty hack that relies on apps that use it not
caring about being messed with.  Very nasty if, for example, someone is
using mod_rewrite (before the change) together with a CGI (after)
and *expecting* it not to change between the two.

Nick Kew

View raw message