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 Bekman            JAm_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

Reply via email to