[Modules] mod_vhost_dbi additional configuration for Virtual Hosts

Edward Rudd urkle at outoforder.cc
Mon Feb 19 23:14:07 EST 2007


The real issue is the configuration system of Apache..  Apache has no
dynamic configuration system.  All configuration is finalized on
startup.  The mod_vhost_dbi has a *hack* to get the PHP openbasedir
functionality in there.  The hack is, mod_vhost_dbi directly calls PHP
functions to alter the configuration outside of mod_php's knowledge.
Which works due to the way PHP works.

The only clean way of implementing a nice system like this is to have
each module expose a hook to allow pieces of it to be dynamically
configured in a Mass Virtual host.  Which, unfortunately requires a bit
of work to get written as both mod_vhost_dbi AND the module you wish to
configure need to be modified.

Graham Weldon wrote:
> Not being intimately familiar with how mod_vhost_dbi works, is it
> possible to provide some generic additional configurability for generic
> modules?
> 
> Something like:
> VhostDbiAdditional <name> V:<value>|Q:<query>
> 
> So you could provide a static value, or the result of a query when
> setting up the vhost.
> 
> Eg:
> eg1:    VhostDbiAdditional "CBandLimit" Q:SELECT bandwidth_limit FROM
> vhost_info WHERE ServerName = &{RequestHostname}
> eg2:    VhostDbiAdditional "ErrorDocument 404" Q:SELECT 404_document
> FROM vhost_info WHERE ServerName = &{RequestHostname}
> eg3:    VhostDbiAdditional LogSQLTransferLogFormat Q:SELECT log_format
> FROM vhost_info WHERE ServerName = &{RequestHostname}
> 
> The last example being a way to allow users to set configurability for
> logging stored (for some reason?) via a database served control panel.
> 
> Again, I am not sure if this is feasible, or easily integrated into the
> module, I am just throwing ideas out there.
> 
> 
> Cheers,
> Graham Weldon
> Software Developer
> 
> 
> Edward Rudd wrote:
>> Unfortunately in order to add the ability for mod_vhost_dbi to configure
>> another module, mod_vhost_dbi needs to be modified a bit to know how to
>> configure mod_cband.. Also mod_cband has to have some kind of *hook* to
>> allow mod_vhost_dbi to configure it.
>>
>> Graham Weldon wrote:
>>   
>>> Hi all,
>>>
>>> I was wondering if anyone could shed some light on how to add additional
>>> configuration options to each virtual host whilst using mod_vhost_dbi
>>> More specifically, I am using a combination of bandwidth management
>>> modules including mod_cband and The bandwidth allowance varies per vhost.
>>> How can I include these settings on a vhost-by-vhost basis?
>>>
>>> Regards,
>>> Graham Weldon
>>> Software Developer
>>>
>>> _______________________________________________
>>> Modules mailing list
>>> Modules at lists.outoforder.cc
>>> http://lists.outoforder.cc/mailman/listinfo/modules
>>>     
>>
>>
>>   
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.outoforder.cc/pipermail/modules/attachments/20070219/16d89397/attachment.bin 


More information about the Modules mailing list