Link to home
Start Free TrialLog in
Avatar of magenta
magenta

asked on

How to pass parameters to an Apache Module from httpd.conf?

I'm trying to figure out how to pass parameters from the httpd.conf file to an apache module initialization routine. All of the examples I can find do not do this, and most do not have an explicit initialization routine.

The init routine signature is:

static void initialize( server_rec *s, pool *p );

The server_rec is passed to the initialize method, so my question is there any way to add initialization parameters to the httpd.conf of apache, and have them show up in the server_rec?

Thanks,
Frank
ASKER CERTIFIED SOLUTION
Avatar of samri
samri
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of magenta
magenta

ASKER

That is interesting, I belive that SetPerlVar used in the httpd.conf sets a variable that is somehow set in the perl environment, so when your perl module runs, it can then pick it up. It's sorta like global variables. Kinda of a kludge but functional...

Unfortunately, my apache modules written in C, not perl. And I've looked at dozens of apache modules and most if not all don't even do initialization, let alone any kind of parameter passing from httpd.com.

Thanks,
Frank
Avatar of periwinkle
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area with the following recommendation for this question:

Delete/Refund

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

periwinkle
EE Cleanup Volunteer