You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim Hunt <ti...@yahoo.com> on 2006/07/31 17:18:54 UTC

mod_jk not compiling correctly (apparently) - 'garbled' error

Hi,
   
  I can't get mod_jk to work - getting 'garbled' error suggesting it's not compiled against same version of apache?  Here's the specifics:
   
  Got fresh install of CentOS 4.3
   
  Installed Apache 2.2.2 with
  # ./configure --enable-rewrite=shared --enable-deflate=shared --enable-alias=shared --enable-cache=shared --enable-dbd=shared --enable-disk-cache=shared --enable-proxy=shared --enable-proxy-ajp=shared
  # make
  # make install
   
  Installed tomcat 5.5.17 with instructions at http://tomcat.apache.org/tomcat-5.5-doc/setup.html
   
  Installed mod_jk 1.2.18 from source including:
  # ./buildconf.sh
  # ./configure --with-apxs=/usr/local/apache2/bin/apxs
  # make
# make install 
   
  Used the auto config option (BTW tomcat created a file called 'mod_jk.conf' NOT 'mod_jk.conf-auto' and I adjusted httpd.conf include statement to match)
   
  But once I included mod_jk.conf into httpd.conf I got an error about mod_jk.so being 'garbled' and possibly not a DSO.
   
  From searching on the error and trying to read up on apxs, it appears mod_jk was not compiled against the correct version of apache.  However, I believe apxs was just newly created when I compiled apache so I'm not sure why it would be different or how to fix it.  I did notice there's another copy of apxs in the /usr/sbin.  using that in the configure command did not work, but I might have messed something else up in the meantime, so let me know if I should try that again.
   
  In case it helps, I did notice that the configure script from mod_jk referred to apache-2.0 and I'm using apache-2.2, but not sure if that's meaningful
   
  Any help suggestions would be greatly appreciated.  (head sore from pounding ;-) )
   
  -Tim

 			
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.

Re: mod_jk not compiling correctly (apparently) - 'garbled' error

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Tim,

> Perhaps you're right about the multiple copies of Apache - that's what
> has been the problem when others got the same error.  However, it doesn't
> look like another copy is there.  Perhaps make output above suggests
> just a problem with building mod_jk?

I'm using Apache 2.0.58 and mod_jk 1.2.18 myself. I compiled the latter
on Friday and got it installed just fine.

Apache 2.2 shouldn't be a problem... I seem to recall that a coworker of
mine is using Apache 2.2 and he recently gave up on mod_proxy_ajp and
went with mod_jk without any issues.

It's strange to see "apache-2.0" messages in your various compilation
outputs. :(

-chris


Re: mod_jk not compiling correctly (apparently) - 'garbled' error

Posted by Tim Hunt <ti...@yahoo.com>.
Found the problem, so in case anyone is interested:
   
  Chris wrote:
  >My suggestion above is almost certainly the problem: you have two
>competing versions of Apache installed. You should pick one and
>uninstall the other. From experience, I have to say that using the
>version available from the package manager (does CentOS use RPM?) is
>almost always better than compiling everything yourself, because
>dependencies are generally checked appropriately, etc. when you let the
>package manager handle everything. Just my .02.
>
>-chris
Despite my claiming Apache wasn't already installed, Chris was right.  Sorry for my mistake and the resulting confusion.  A 'yum list installed httpd' showed the previous version was present, and that explains the problem.  We can at least get mod_jk compiled and installed now.  Thanks for the help Chris!
   
  -Tim
  
 

 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.

Re: mod_jk not compiling correctly (apparently) - 'garbled' error

Posted by Tim Hunt <ti...@yahoo.com>.
THANKS Chris, here are some answers/clarifications:
   
  >>   Installed Apache 2.2.2 with
>>   # ./configure --enable-rewrite=shared --enable-deflate=shared \
>>                 --enable-alias=shared --enable-cache=shared \
>>                 --enable-dbd=shared --enable-disk-cache=shared \
>>                 --enable-proxy=shared --enable-proxy-ajp=shared
>>   # make
>>   # make install
>
>Does --enable-FOO=shared automatically enable DSOs? Sounds like a 
>stupid
>question, but everything else you did looks good.
I do not really know, but just your asking reminded me of what I do
know, which is that I have to include '--enable-so' for DSOs to work.
I forgot it in the above so I'll go back and add it.
  >>   Installed mod_jk 1.2.18 from source including:
>>   # ./buildconf.sh
>>   # ./configure --with-apxs=/usr/local/apache2/bin/apxs
>>   # make
>>   # make install 
  >Are you sure that /usr/local/apache2/bin/apxs is the right one to
>choose? Where did "make install" put everything when you installed 
>Apache?
>
>You did say that you had a fresh install of CentOS, so I can't imagine
>that you have a competing version of Apache in there. :(
  I do not think there was a competing installation of apache.  After the
first failure, we reformated the disk and reinstalled CentOS to get a
clean start (same as 1st time).  Before installing anything I searched
for apxs:
# find / -name apxs
and did not find anything.  HOWEVER, the /etc/httpd directory and files
WERE already there before apache was installed.
  "make install" is setting up apache in /usr/local/apache2 and that
directory was NOT present before.
  
>> But once I included mod_jk.conf into httpd.conf I got an error about
>> mod_jk.so being 'garbled' and possibly not a DSO.
>
>Can you post the exact error message? I assume you get this message on
>startup?
Sorry I've not gotten back to the point where I do it again, but here's
a similar error someone else posted (at experts-exchage):
  Syntax error on line 8 of
/usr/local/jakarta-tomcat-3.2.1/conf/mod_jk.conf-auto:
API module structure `jk_module' in file
/usr/local/apache/libexec/mod_jk.so is garbled - perhaps this is not
an Apache module DSO?
  Note, my paths and potentially other details are different - I'll post
my exact error again when I can (if still interested)
  [snip]
  >Aah. Is it possible that you installed Apache as part of the OS
>installation, and then you compiled it yourself as well? That could
>explain what's going on: you are building mod_jk against
>/usr/local/apache2/bin/apxs, but then you are starting the server using
>the packaged Apache??
>
>Just grasping at straws.
Again, I don't think so, but if there's something else I should check,
let me know.  I didn't find anything about it querying RPM and didn't
see any directories except /etc/httpd
  >> In case it helps, I did notice that the configure script from mod_jk
>> referred to apache-2.0 and I'm using apache-2.2, but not sure if that's
>> meaningful
My colleague who's trying to redo this noticed that running make for 
mod_jk seems to send output suggesting somethings going wrong.
Here's part of it.
  <start paste>
make[1]: Leaving directory `/usr/local/src/tomcat-connectors-1.2.18-src/native'
target="all"; \
list='common apache-2.0'; \
for i in $list; do \
   echo "Making $target in $i"; \
   if test "$i" != "."; then \
      (cd $i && make $target) || exit 1; \
   fi; \
done;
  Making all in common
make[1]: Entering directory
  `/usr/local/src/tomcat-connectors-1.2.18-src/native/common'
<end paste>
  Notice how it seems to be showing code for a loop
which worries me that it is showing it instead of executing it.
  
>My suggestion above is almost certainly the problem: you have two
>competing versions of Apache installed. You should pick one and
>uninstall the other. From experience, I have to say that using the
>version available from the package manager (does CentOS use RPM?) is
>almost always better than compiling everything yourself, because
>dependencies are generally checked appropriately, etc. when you let the
>package manager handle everything. Just my .02.
>
>-chris
Perhaps you're right about the multiple copies of Apache - that's what
has been the problem when others got the same error.  However, it doesn't
look like another copy is there.  Perhaps make output above suggests
just a problem with building mod_jk?
  Thanks again!
-Tim
   

 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.

Re: mod_jk not compiling correctly (apparently) - 'garbled' error

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Tim,

> I can't get mod_jk to work - getting 'garbled' error suggesting it's
> not compiled against same version of apache?  Here's the specifics:

[snip]

>   Installed Apache 2.2.2 with
>   # ./configure --enable-rewrite=shared --enable-deflate=shared \
>                 --enable-alias=shared --enable-cache=shared \
>                 --enable-dbd=shared --enable-disk-cache=shared \
>                 --enable-proxy=shared --enable-proxy-ajp=shared
>   # make
>   # make install

Does --enable-FOO=shared automatically enable DSOs? Sounds like a stupid
question, but everything else you did looks good.

>   Installed mod_jk 1.2.18 from source including:
>   # ./buildconf.sh
>   # ./configure --with-apxs=/usr/local/apache2/bin/apxs
>   # make
>   # make install 

Are you sure that /usr/local/apache2/bin/apxs is the right one to
choose? Where did "make install" put everything when you installed Apache?

You did say that you had a fresh install of CentOS, so I can't imagine
that you have a competing version of Apache in there. :(

> But once I included mod_jk.conf into httpd.conf I got an error about
> mod_jk.so being 'garbled' and possibly not a DSO.

Can you post the exact error message? I assume you get this message on
startup?

> 
> From searching on the error and trying to read up on apxs, it appears
> 
> mod_jk was not compiled against the correct version of apache. However,
> I believe apxs was just newly created when I compiled apache so I'm not
> sure why it would be different or how to fix it. I did notice there's
> another copy of apxs in the /usr/sbin. using that in the configure
> command did not work, but I might have messed something else up in the
> meantime, so let me know if I should try that again.

Aah. Is it possible that you installed Apache as part of the OS
installation, and then you compiled it yourself as well? That could
explain what's going on: you are building mod_jk against
/usr/local/apache2/bin/apxs, but then you are starting the server using
the packaged Apache??

Just grasping at straws.

> In case it helps, I did notice that the configure script from mod_jk
> referred to apache-2.0 and I'm using apache-2.2, but not sure if that's
> meaningful

My suggestion above is almost certainly the problem: you have two
competing versions of Apache installed. You should pick one and
uninstall the other. From experience, I have to say that using the
version available from the package manager (does CentOS use RPM?) is
almost always better than compiling everything yourself, because
dependencies are generally checked appropriately, etc. when you let the
package manager handle everything. Just my .02.

-chris