Solved

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

Posted on 2002-06-12
3
364 Views
Last Modified: 2010-03-04
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
0
Comment
Question by:magenta
3 Comments
 
LVL 15

Accepted Solution

by:
samri earned 200 total points
Comment Utility
Frank,

Gee... almost a week and nobody ever look in here :)

Up front, I do not have any knowledge in C (or C++) programming.  However I would try to give some pointers that might get you moving.
--enough the disclaimer.

One possible alternative is to look at the exising Apache modules (http://modules.apache.org/)  Most of the modules do have the source code tarball.  And I noticed that in the example httpd.conf (or .htaccess) usage, there is thing like "SetPerlVar  var value", I think this should be the way parameters are passed to the modules, and in the module coding, there should be a way to retrieve this information back.


Check
http://modules.apache.org/
http://modules.apache.org/reference

I hope *some* of the info might be useful.

cheers.
0
 

Author Comment

by:magenta
Comment Utility
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
0
 
LVL 15

Expert Comment

by:periwinkle
Comment Utility
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
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now