You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ondřej Surý <on...@sury.org> on 2010/11/25 10:33:01 UTC

Generic way how to inject configuration from one module to another

Hi,

since people keep asking for that I'll ask here.

Is there a generic way how to modify configuration of some other
module from within f.e. mod-vhost-* modules? Somethink like per_dir
configuration?

I know it can be done, but you'll have to know the data structures and
link with header files of that module.

Use case:

1. Apache server using mod_vhost_ldap
2. Apache server using mod_php5
3. You want to be able to turn php_engine On/Off from the LDAP

mod_vhost_ldap would read the configuration from LDAP and inject
php_engine flag somewhere to vhost configuration in a generic way so
when mod_php5 is run it has the correct value of php_engine (the one
from LDAP).

Ondrej
-- 
Ondřej Surý <on...@sury.org>

Re: Generic way how to inject configuration from one module to another

Posted by Ondřej Surý <on...@sury.org>.
Hi Guenter,

thanks for the patch. It's the example of how I don't want to do it
:-). I don't want to have code specific to the module I modify (zend_*
in your patch).

Ondrej

On Thu, Nov 25, 2010 at 11:10, Guenter Knauf <fu...@apache.org> wrote:
> Hi Ondřej,
> Am 25.11.2010 10:33, schrieb Ondřej Surý:
>>
>> since people keep asking for that I'll ask here.
>>
>> Is there a generic way how to modify configuration of some other
>> module from within f.e. mod-vhost-* modules? Somethink like per_dir
>> configuration?
>>
>> I know it can be done, but you'll have to know the data structures and
>> link with header files of that module.
>>
>> Use case:
>>
>> 1. Apache server using mod_vhost_ldap
>> 2. Apache server using mod_php5
>> 3. You want to be able to turn php_engine On/Off from the LDAP
>>
>> mod_vhost_ldap would read the configuration from LDAP and inject
>> php_engine flag somewhere to vhost configuration in a generic way so
>> when mod_php5 is run it has the correct value of php_engine (the one
>> from LDAP).
>>
>> Ondrej
>
> I did just check my source dir of your module, and found there a 4+ years
> old patch hanging around which I found somewhere but never tried ...
> maybe that can point you into the right direction ...
>
> Gün.
>
>
>



-- 
Ondřej Surý <on...@sury.org>

Re: Generic way how to inject configuration from one module to another

Posted by Guenter Knauf <fu...@apache.org>.
Hi Ondřej,
Am 25.11.2010 10:33, schrieb Ondřej Surý:
> since people keep asking for that I'll ask here.
>
> Is there a generic way how to modify configuration of some other
> module from within f.e. mod-vhost-* modules? Somethink like per_dir
> configuration?
>
> I know it can be done, but you'll have to know the data structures and
> link with header files of that module.
>
> Use case:
>
> 1. Apache server using mod_vhost_ldap
> 2. Apache server using mod_php5
> 3. You want to be able to turn php_engine On/Off from the LDAP
>
> mod_vhost_ldap would read the configuration from LDAP and inject
> php_engine flag somewhere to vhost configuration in a generic way so
> when mod_php5 is run it has the correct value of php_engine (the one
> from LDAP).
>
> Ondrej
I did just check my source dir of your module, and found there a 4+ 
years old patch hanging around which I found somewhere but never tried ...
maybe that can point you into the right direction ...

Gün.