httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <>
Subject Change a Module's Configuration, was Re: [apache-modules] How does a module specify the equivalent of AcceptPathInfo On
Date Tue, 30 Mar 2004 20:27:28 GMT
On Sat, 2004-03-27 at 21:54, Joe Lewis wrote:
> Allow me to rephrase that in a way I think you are meaning.  You are 
> trying to use one module to alter the configuration of another module.  
> It really shouldn't be done.  However, anything is possible.  Using the 
> ap_get_module_config in a case where you are grabbing the configuration 
> of the other module, you are going to have all kinds of linking problems 
> - if you do it this way, it means you have to redefine the core module.
You can easily get the core module config:

#include "http_core.h"


core_server_config * conf = (core_server_config *)
ap_get_module_config(r->server->module_config, &core_module);
conf->accept_path_info = 1;

This is a completely evil hack and should never _ever_ be used.

I believe the inability to change another module's configuration is a
design flaw in Apache 2.0. 

I am hitting this problem in my mod_vhost_dbi module. My module stores
all the information on a virtual host in a database(pgsql, mysql,
sqlite, oracle or msql). It is difficult for my module to create a vhost
environment on-the-fly and change configuration directives as needed.  

I am interested in creating a generic API for changing configuration
on-the-fly within a running httpd.  Todo it right, it might take many
large changes.  I think there would still be some configuration options
that would be marked "init only", but many others could be changed
dynamically.  The easy way might be to hook into how .htaccess files

I would want to get a couple people within the httpd-core to support
such a change in concept before spending too much time on it.

This would be an awesome feature to push into 2.1 or 2.3(if 2.2 is ever
released). It opens up a wide variety of possibilities for module

-Paul Querna

View raw message