Solved

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

Posted on 2002-06-12
3
367 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
ID: 7093098
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
ID: 7093521
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
ID: 9690959
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Ubuntu 14 with Apache 7 80
LAMP problem identifier tool ? 9 123
Utility for identifying files that are different 5 85
Apache LDAP Authentication 20 34
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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