How to define custom configuration directives for my Apache module?

What I want to do is pass some settings to my module from httpd.conf, for example:

<Location /path> SetHandler mymodule-handler # based on this, the module will kick in and "try" to read settings MyCustomStringSetting "AStringValue" MyCustomIntegerSetting 2012 # more </Location> 

How can I get "AStringValue" and "2012" from the module?

+4
source share
1 answer

Here is a complete example (with source) from the "Apache: The Definitive Guide":

http://docstore.mik.ua/orelly/linux/apache/ch15_04.htm

The mod_reveal module example implements two commands: RevealServerTag and RevealTag.

In server configuration, these two new commands can be used:

 <VirtualHost :9000> DocumentRoot /home/camilla/WWW/docs RevealTag H2Main RevealServerTag H2 </VirtualHost> 

And then processed by the module.

+6
source

Source: https://habr.com/ru/post/1397417/


All Articles