httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: what should be done in a vhost_db module?
Date Tue, 08 Apr 2008 21:34:29 GMT
Robert Schulze wrote:
> Tom Donovan schrieb:
>
> >
>> In a threaded mpm, the same r->server struct is used by multiple 
>> requests simultaneously.  It isn't safe to change anything in it on 
>> the fly.
>
> OK, thats a pity.
>
> I now tried to set several other variables ("Host" in r->headers_in, 
> r->hostname, etc.) but all those settings did not set the hostname of 
> the virtualhost. You can see that by inspecting /server-status/ and 
> have a look at accesslogs. There will always be the main servername 
> used instead of anything crafted from the module.
>
> In this way, this stuff is useless :-(
> Does anybody know, how to set the hostname for the virtualhost 
> correctly, so that other modules might gather the correct info from 
> the request?
>
>
> One more bad thing is, that one can't set the DocumentRoot without 
> (once again) playing with the core configuration. Simply setting
>
>     apr_table_set(r->subprocess_env, "DOCUMENT_ROOT","/foo/var");
>
> is not enough, since that value will magically become overwritten by 
> later work from apache :-(
>
>
> BTW: I looked at mod_vhost_alias, mod_vhost_dbi, mod_vhost_ldap, 
> mod_vhost-modules to get knowledge about how to write a module and so 
> on, so please point me to them :-)

The magic all happens in the :

ap_hook_translate_name

hook.  That is the function to examine to see what it does.

-- 
Joseph Lewis <http://sharktooth.org/>

Mime
View raw message