Re: mod_perl & mod_jk
MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) wrote: I think I found the problem - it was because of a LoadModule directive that was defined in 1.99-07, but renamed to PerlLoadModule in 1.99-08. The reason why I ran into the problem of unable to load mod_jk, was because I was trying to load mod_jk after the mod_perl is loaded. What was happening is that the mod_perl directives' gets registered with Apache as soon as mod_perl is loaded. With the LoadModule defined by mod_perl also, apache's ap_find_command_in_modules command returns a pointer to mod_perl's loadmodule function (modperl_cmd_load_module), instead of apache's load_module function (because mod_perl is the first in the modp list). And then, to complicate the matters, the cmd->req_override is not set to EXEC_ON_READ - thus mod_jk is never loaded.. Question: Is it okay if I rename LoadModule to PerlLoadModule in 1.99-07, and continue with it ?. Does it need more modifications than just renaming it ?.. Should be just that (though some tests will fail, but ignore that) Index: src/modules/perl/mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.141 retrieving revision 1.142 diff -u -r1.141 -r1.142 --- src/modules/perl/mod_perl.c 17 Sep 2002 02:05:21 - 1.141 +++ src/modules/perl/mod_perl.c 7 Oct 2002 02:05:43 - 1.142 @@ -636,7 +636,7 @@ MP_CMD_DIR_RAW_ARGS_ON_READ("=cut", pod_cut, "End of POD"), MP_CMD_DIR_RAW_ARGS_ON_READ("__END__", END, "Stop reading config"), -MP_CMD_SRV_RAW_ARGS("LoadModule", load_module, "A Perl module"), +MP_CMD_SRV_RAW_ARGS("PerlLoadModule", load_module, "A Perl module"), #ifdef MP_TRACE MP_CMD_SRV_TAKE1("PerlTrace", trace, "Trace level"), #endif Thanks for the debugging pointers, You are welcome ;) __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
RE: mod_perl & mod_jk
I think I found the problem - it was because of a LoadModule directive that was defined in 1.99-07, but renamed to PerlLoadModule in 1.99-08. The reason why I ran into the problem of unable to load mod_jk, was because I was trying to load mod_jk after the mod_perl is loaded. What was happening is that the mod_perl directives' gets registered with Apache as soon as mod_perl is loaded. With the LoadModule defined by mod_perl also, apache's ap_find_command_in_modules command returns a pointer to mod_perl's loadmodule function (modperl_cmd_load_module), instead of apache's load_module function (because mod_perl is the first in the modp list). And then, to complicate the matters, the cmd->req_override is not set to EXEC_ON_READ - thus mod_jk is never loaded.. Question: Is it okay if I rename LoadModule to PerlLoadModule in 1.99-07, and continue with it ?. Does it need more modifications than just renaming it ?.. Thanks for the debugging pointers, -Madhu -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 12, 2003 3:42 PM To: MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: Re: mod_perl & mod_jk MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) wrote: > Hi, > I'm trying to use mod_perl (1.99-07) with mod_jk (1.2) and Apache > (2.0.43). (and cannot move to 1.99-08 immediately) > When I try starting apache with both mod_perl & mod_jk enabled, I'm seeing > the following error : > > $ sudo bin/apachectl start > Syntax error on line 8 of /opt/apache2/conf/mod_jk.conf: > Invalid command 'JkWorkersFile', perhaps mis-spelled or defined by a module > not included in the server configuration > > Any ideas what might be happening ?.. You say that it's working fine with 1.99_08, but I don't think anything significant has been changed in the configuration parsing between _07 and _08. Have you tried stepping through with gdb? It should be pretty easy to do if you use this script: http://perl.apache.org/docs/2.0/devel/debug/code/.debug-modperl-register as discussed here: http://perl.apache.org/docs/2.0/devel/debug/c.html#Precooked_gdb_Startup_Scr ipts You want to break at ap_find_command_in_modules, where the directive is searched for. It simply goes though the list of registered modules and asks each module whether it knows this command: for (modp = *mod; modp; modp = modp->next) { if (modp->cmds && (cmdp = ap_find_command(cmd_name, modp->cmds))) { *mod = modp; return cmdp; } } If you see that mod_jk is not in that list, you have to go back earlier and see why it failed to get mod_jk into the list. Somewhere around ap_add_module. p.s. I use ddd over gdb, which makes the debugging a much easier task. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl & mod_jk
MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) wrote: Hi, I'm trying to use mod_perl (1.99-07) with mod_jk (1.2) and Apache (2.0.43). (and cannot move to 1.99-08 immediately) When I try starting apache with both mod_perl & mod_jk enabled, I'm seeing the following error : $ sudo bin/apachectl start Syntax error on line 8 of /opt/apache2/conf/mod_jk.conf: Invalid command 'JkWorkersFile', perhaps mis-spelled or defined by a module not included in the server configuration Any ideas what might be happening ?.. You say that it's working fine with 1.99_08, but I don't think anything significant has been changed in the configuration parsing between _07 and _08. Have you tried stepping through with gdb? It should be pretty easy to do if you use this script: http://perl.apache.org/docs/2.0/devel/debug/code/.debug-modperl-register as discussed here: http://perl.apache.org/docs/2.0/devel/debug/c.html#Precooked_gdb_Startup_Scripts You want to break at ap_find_command_in_modules, where the directive is searched for. It simply goes though the list of registered modules and asks each module whether it knows this command: for (modp = *mod; modp; modp = modp->next) { if (modp->cmds && (cmdp = ap_find_command(cmd_name, modp->cmds))) { *mod = modp; return cmdp; } } If you see that mod_jk is not in that list, you have to go back earlier and see why it failed to get mod_jk into the list. Somewhere around ap_add_module. p.s. I use ddd over gdb, which makes the debugging a much easier task. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com