[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2002-06-12
3
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
samri earned 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

650 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