httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] Defining mandatory parameters for Apache modules
Date Thu, 13 Aug 2009 17:00:21 GMT
Raj Iyer wrote:
> Hello, 
> 
> The Apache web server on start up iterates through the list of
> configuration directives and invokes the associated module handler for
> each directive. 
> 
> For e.g. if module A has handlers for directives D1 and D2, then the
> httpd process on start up will invoke the handlers within module A when
> it encounters D1 and D2 in httpd.conf.
> 
> However, what is the best way to find out missing mandatory parameters
> from within the module. For e.g. if a directive D3 is mandatory for the
> module to work, then how can the module on initialization guarantee that
> this configuration parameter is provided? 
> 
> I do not want to provide a default value for this mandatory
> configuration directive and also, I do not want to check whether this
> mandatory directive is defined or not while handling each request. 
> 
Hi.
I do not know the answer to the above in all generality, for example for 
an Apache add-on module written in C.
But you may want to look at this :
http://perl.apache.org/docs/2.0/user/handlers/server.html
It is about mod_perl, but mod_perl closely follows the innards of 
Apache, so I am quite sure that there must exist something similar to 
the PerlPostConfigHandler as a hook into Apache from a C module.
The idea is : your module could define a function and register it with 
Apache using that hook. The function would be called when the Apache 
configuration is fully read, could check that all your directives have 
been encountered, and throw an error if not.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message