You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Lubo <ma...@fan-space.de> on 2004/01/05 11:39:06 UTC

how to set external module variable in other httpd-module

Hello,

i am using mod_vdbh with MySQL database for my Virtual Hosts. I need to implement one feature in mod_vdbh, which allows to change external (mod_php) variable "open_basedir" to different vaules (based on Virtualhost-home directory). This variable can be set directly in php.ini or in httpd.conf with:

php_admin_value open_basedir /mnt/webs/.....

I need to change this variable from within this module mod_vdbh. The idea is, that every virtual host should have his own open_basedir value (/mnt/webs/user1, /mnt/webs/user2), etc...

Is it possible ? I spend some time with apache-API, documentation, programming, but I have no idea, how can I do that ...

Thank you for any help and ideas ...

Best regards,
Lubo.



Re: how to set external module variable in other httpd-module

Posted by Paul Querna <ch...@force-elite.com>.
Lubo wrote:
 > I need to change this variable from within this module mod_vdbh. The
 > idea is, that every virtual host should have his own open_basedir
 > value (/mnt/webs/user1, /mnt/webs/user2), etc...
 >
 > Is it possible ? I spend some time with apache-API, documentation,
 > programming, but I have no idea, how can I do that ...

Not only is it possible, I wrote one.

This code is originally based off of mod_vdbh, but I converted it to use 
libdbi and added a few other things.  It includes the ability to set PHP 
safemode/open_basedir values based on database records.

This code is very "alpha" and was written more as a proof of concept, It 
does however "work for me".

It doesn't cache the results, so deploying this on a live server is 
questionable.

YMMV. Completely Unsupported. Etc.

Source: http://force-elite.com/~chip/mod_vhost_dbi.tar.gz

I know many people want this type of functionality(mass vhosting from 
*sql), but i simply don't have enough time to work on this module with 
my other commitments.

-Paul Querna