You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Raj Iyer <Ra...@openwave.com> on 2009/08/13 12:59:21 UTC

[users@httpd] Defining mandatory parameters for Apache modules

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. 

 

Thanks in advance,

Best regards,

Raj Iyer


Re: [users@httpd] Defining mandatory parameters for Apache modules

Posted by André Warnier <aw...@ice-sa.com>.
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


Re: [users@httpd] Defining mandatory parameters for Apache modules

Posted by Dan Poirier <po...@pobox.com>.
On 08/13/2009 06:59 AM, Raj Iyer wrote:
>
>
> 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.
>
This is a better question for the dev@httpd.apache.org list, but look at 
the post_config hook.

-- 
Dan Poirier <po...@pobox.com>
A positive attitude may not solve all your problems, but it will annoy 
enough people to make it worth the effort. -- Herm Albright