httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: ServerRoot in server rec?
Date Sun, 11 Sep 2005 17:22:27 GMT
Brian Candler wrote:
> I wondered if any consideration had been given to making ServerRoot an
> option which could be overridden per virtual-server (e.g. as a member of
> struct server_rec)?

Because ServerRoot runs during configuration file parsing, this turns
out to be extraordinarily difficult.  You can reset ServerRoot multiple
times in your config file, but it's side effects are, uhm, interesting.

> The particular issue I have is with mass virtual hosting and directives like
> AuthUserFile in .htaccess files. If you have
> 
>     ServerRoot /web/sites
> 
> but a hashed directory structure for individual virtual hosts, e.g.
> 
>     <VirtualHost ...>
>     ServerName www.example.com
>     DocumentRoot /web/sites/1/6b/3f92/html
>     </VirtualHost>
> 
> then all the .htaccess files for this site must know about (and hard-code)
> the hashed directory path, e.g.
> 
>     AuthUserFile 1/6b/3f92/security/users
> or
>     AuthUserFile /web/sites/1/6b/3f92/security/users
> 
> (At least, this is the case with Apache 1.3, but I've had a quick look at
> the source code for 2.1.7-beta and as far as I can tell it's the same)
> 
> So, it's difficult to build a site in such a way that it's robust against
> migrations between one server and another, where it may sit in a different
> hashed location. But:
> 
>     <VirtualHost ...>
>     ServerName www.example.com
>     ServerRoot /web/sites/1/6b/3f92
>     DocumentRoot /web/sites/1/6b/3f92/html
>     </VirtualHost>
> 
> would allow
> 
>     AuthUserFile security/users
> 
> Has this feature already been considered and rejected (and if so, why)?

I was about to argue against changing ServerRoot, for reasons mentioned
above... but I have a second idea;

If ServerRoot has a different meaning within a <Container > block, then
the original behavior of ServerRoot could be retained for any occurance
in the global scope, and have a local behavior for the block scopes.

Let me play with this after 2.0.55/2.1.8-beta are cooked.  Perhaps we
can have something together before 2.2 is baked.

Bill


Mime
View raw message