You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by John Zhang <jo...@yahoo.com> on 2007/11/02 02:58:52 UTC
apache 2.0.61 do not read config settings
I have a module for 2.2x, and have some config
settings like
<IfModule my_module>
...
MyName foo
...
</IfModule>
and I can get the configurations per the AP_INIT_TAKEx
macro. However, when I compiled my module against
apache 2.0.61, my functions for setting the parameters
are not called.
Anything specif I have to do to make the functions to
be called (so the config parameters are read).
Thanks,
John
Re: How to request a file in apache module?
Posted by Nick Kew <ni...@webthing.com>.
On Wed, 14 Nov 2007 09:24:54 -0800 (PST)
John Zhang <jo...@yahoo.com> wrote:
> I have the follow need:
> While processing a request in my module (handler or
> output filter), I need to ask apache to give me the
> content of another page. Is there any way to do that,
> or do I have to find the file and read it just within
> my module?
Take a look at mod_include's handling of <!--#include ...-->.
That shows how to include a file, and apply apache's default
security model to it.
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/
How to request a file in apache module?
Posted by John Zhang <jo...@yahoo.com>.
I have the follow need:
While processing a request in my module (handler or
output filter), I need to ask apache to give me the
content of another page. Is there any way to do that,
or do I have to find the file and read it just within
my module?
Thanks in Advance for any help!
John
Re: apache 2.0.61 do not read config settings
Posted by John Zhang <jo...@yahoo.com>.
--- Joe Lewis wrote:
> John Zhang wrote:
> > --- Joe Lewis wrote:
> >
> >> Comment out the IfModule pieces surrounding your
> >> directive just to eliminate one more thing.
> >>
> >
> > Commenting out the IfModule does make it work!
>
> > Now, how do I figure out the EXACT module name?
>
> When you compile your module using apxs, there could
> (or should) be a -n
> option. This is specifying the module name and is
> required in -g, but
> "guessed" in a -i mode. Just type "man apxs" for
> more information. Use
> that name when testing an IfModule.
>
Thanks for the help. I never used apxs. My module
was compiled using Visual studio. Through debugging
the apache code here is what I found out:
In apache 2.2x, I can say
LoadModule my_module "the location of my
module/mod_my.so"
<IfModule my_module>
...
</IfModule>
but in 2.0, I have to change the IfModule to
<IfModule mod_my.c>
With <IfModule my_module>, the entire block is skipped
because it cannot find a model with name "my_module".
Not sure if this the right way. Any comments would be
preciated.
Thanks,
John
Re: apache 2.0.61 do not read config settings
Posted by Joe Lewis <jo...@joe-lewis.com>.
John Zhang wrote:
> --- Joe Lewis wrote:
>
>> Comment out the IfModule pieces surrounding your
>> directive just to eliminate one more thing.
>>
>
> Commenting out the IfModule does make it work!
> Now, how do I figure out the EXACT module name?
When you compile your module using apxs, there could (or should) be a -n
option. This is specifying the module name and is required in -g, but
"guessed" in a -i mode. Just type "man apxs" for more information. Use
that name when testing an IfModule.
Joe
Re: apache 2.0.61 do not read config settings
Posted by John Zhang <jo...@yahoo.com>.
--- Joe Lewis wrote:
> Comment out the IfModule pieces surrounding your
> directive just to
> eliminate one more thing. How do we know that the
> problem is the
> directive itself, when it could be that apxs
> compiled it with a
> different "my_mod.c" definition and the IfModule is
> what is really
> preventing your directive from being called?
>
> If that doesn't reveal anything additional, try
> providing us with the
> my_func function (and at least the declaration).
>
Thanks Joe,
Commenting out the IfModule does make it work!
Now, how do I figure out the EXACT module name? I am
still in the early stage of using apache.
Here are some of the config stuff
LoadModule my_module "C:/foo/.../mod_my.so"
<IfModule my_module>
MyName foo
</IfModule>
mod_my.so is compiled against apache 2.2 first (and
the above config structure worked). When I tried
apache 2.0, I merely pointing the *.lib and *.h files
to the apache 2.0 folders (to generate the mod_my.so
for apache 2.0).
Thanks again for your help any further suggestions.
John
Re: apache 2.0.61 do not read config settings
Posted by Joe Lewis <jo...@joe-lewis.com>.
John Zhang wrote:
> --- "William A. Rowe, Jr." wrote:
>
>
>> Is your cmd array listed in your module data
>> section?
>>
>>
> yes. Everything worked fine in apache 2.2.
Comment out the IfModule pieces surrounding your directive just to
eliminate one more thing. How do we know that the problem is the
directive itself, when it could be that apxs compiled it with a
different "my_mod.c" definition and the IfModule is what is really
preventing your directive from being called?
If that doesn't reveal anything additional, try providing us with the
my_func function (and at least the declaration).
Joe
--
Joseph Lewis <http://sharktooth.org/>
"Divide the fire, and you will sooner put it out." - Publius Syrus
Re: apache 2.0.61 do not read config settings
Posted by John Zhang <jo...@yahoo.com>.
--- "William A. Rowe, Jr." wrote:
> Is your cmd array listed in your module data
> section?
>
yes. Everything worked fine in apache 2.2. The
structure looked like this:
static const command_rec mod_my_cmds[] = {
AP_INIT_TAKEx("MyName", my_func, NULL, RSRC_CONF, "my
comments",
...,
{NULL}
};
module AP_MODULE_DECLARE_DATA my_module = {
STANDARD20_MODULE_STUFF,
...
mod_my_cmds,
register_hooks
};
my_func is declared and defined somewhere. But
appears never called.
Re: apache 2.0.61 do not read config settings
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
John Zhang wrote:
>
> Anything specif I have to do to make the functions to
> be called (so the config parameters are read).
Is your cmd array listed in your module data section?