Solved

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

Posted on 2002-06-12
3
366 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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