LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   mod_jk and Apache 2.2 (https://www.linuxquestions.org/questions/linux-enterprise-47/mod_jk-and-apache-2-2-a-526752/)

gdeckler 02-08-2007 10:06 AM

mod_jk and Apache 2.2
 
I am trying to get mod_jk to work with an Apache 2.2 implementation and having zero luck.

I am looking for either a mod_jk compiled for Apache 2.2 or for help with compiling mod_jk (details below).

My environment is RedHat ES4 on i386 architecture. I am using XAMPP 1.5.3a with Apache 2.2.2 and have the appropriate XAMPP devel package installed as well.

I have been out to the Tomcat Connectors website and downloaded the latest binaries for Linux and they do not work. Essentially "garbled DSO" errors.

Tomcat Connectors FAQ states that mod_jk works with Apache 2.2 but that you need a .so that is compiled for 2.2.

Any assistance is greatly appreciated as I am up against a wall to get this working.

Here are my Compile Details:

Downloaded mod_jk source

./configure --with-apxs2=/opt/lampp/bin/apxs --with-apache=/usr/local/src/lampp/

This works, then "make" gives:

...
gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -g -O2 -I /include -I /include/ -c jk_status.c -o jk_status.o >/dev/null 2>&1
make[1]: Leaving directory `/home/gdeckler/tomcat-connectors-1.2.20-src/native/common'
Making all in apache-2.0
make[1]: Entering directory `/home/gdeckler/tomcat-connectors-1.2.20-src/native/apache-2.0'
/bin/sh ../libtool --mode=compile gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -g -O2 -c mod_jk.c -o mod_jk.lo
mkdir .libs
gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -g -O2 -c mod_jk.c -fPIC -DPIC -o .libs/mod_jk.o
In file included from /usr/local/src/lampp//include/ap_config.h:25,
from mod_jk.c:29:
/usr/local/src/lampp//include/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t'
In file included from mod_jk.c:32:
/usr/local/src/lampp//include/apr_file_info.h:204: error: expected specifier-qualifier-list before 'apr_off_t'
In file included from mod_jk.c:33:
/usr/local/src/lampp//include/apr_file_io.h:548: error: expected declaration specifiers or '...' before 'apr_off_t'
/usr/local/src/lampp//include/apr_file_io.h:740: error: expected declaration specifiers or '...' before 'apr_off_t'
In file included from /usr/local/src/lampp//include/httpd.h:53,
from mod_jk.c:34:
...

I checked where things start to go wrong:
/usr/local/src/lampp//include/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t'

and line 270 of apr.h is the typdef off64_t line below:

typedef size_t apr_size_t;
typedef ssize_t apr_ssize_t;
typedef off64_t apr_off_t;
typedef socklen_t apr_socklen_t;

Which doesn't look particularly heinous.

Here is my environment

RedHat ES4 OS
i386 environment

My build environment:

· Download: glibc-kernheaders-3.0-5.2.i386.rpm
· Download: glibc-common-2.5.90-16.i386.rpm
· Download: glibc-2.5.90-16.i386.rpm
· Download: glibc-headers-2.5.90-16.i386.rpm
· Download: binutils-2.17.50.0.9-1.i386.rpm
· Download: glibc-devel-2.5.90-16.i386.rpm
· Download: libgomp-4.1.1-55.i386.rpm
· Download: libgcc-4.1.1-55.i386.rpm
· Download: cpp-4.1.1-55.i386.rpm
· Download: gcc-4.1.1-55.i386.rpm
· Download: libstdc++-4.1.1-55.i386.rpm
· Download: libstdc++-devel-4.1.1-55.i386.rpm
· Download: gcc-c++-4.1.1-55.i386.rpm
· Download: libpng-1.2.8-2.2.1.i386.rpm
· Download: cairo-1.3.12-1.fc7.i386.rpm
· Download: glib2-2.12.9-3.fc7.i386.rpm
· Download: libthai-0.1.7-5.fc7.i386.rpm
· Download: filesystem-2.4.1-1.i386.rpm
· Download: xorg-x11-filesystem-7.1-2.fc6.noarch.rpm
· Download: libXau-1.0.3-1.fc7.i386.rpm
· Download: libXdmcp-1.0.2-2.fc7.i386.rpm
· Download: libX11-1.0.3-7.fc7.i386.rpm
· Download: libXext-1.0.1-2.1.i386.rpm
· Download: libXft-2.1.8.2-3.2.i386.rpm
· Download: libXrender-0.9.2-1.fc7.i386.rpm
· Download: pango-1.15.5-1.fc7.i386.rpm
· Download: libgcj-4.1.1-55.i386.rpm
· Download: libobjc-4.1.1-55.i386.rpm
· Download: gcc-objc-4.1.1-55.i386.rpm

· rpm -ivh glibc-kernheaders-3.0-5.2.i386.rpm
· rpm –Fvh glibc*
· rpm -ivh glibc-headers-2.5.90-16.i386.rpm
· rpm -Fvh binutils-2.17.50.0.9-1.i386.rpm
· rpm -ivh glibc-devel-2.5.90-16.i386.rpm
· rpm -ivh libgomp-4.1.1-55.i386.rpm
· rpm -Fvh libgcc-4.1.1-55.i386.rpm
· rpm -ivh cpp-4.1.1-55.i386.rpm
· rpm -ivh gcc-4.1.1-55.i386.rpm
· rpm -Fvh libstdc++-4.1.1-55.i386.rpm
· rpm -ivh libstdc++-devel-4.1.1-55.i386.rpm
· rpm -ivh gcc-c++-4.1.1-55.i386.rpm
· rpm -Fvh libpng-1.2.8-2.2.1.i386.rpm
· rpm -ivh --nodeps cairo-1.3.12-1.fc7.i386.rpm
· rpm -Fvh glib2-2.12.9-3.fc7.i386.rpm
· rpm -ivh libthai-0.1.7-5.fc7.i386.rpm
· rpm -Fvh filesystem-2.4.1-1.i386.rpm
· rpm -ivh xorg-x11-filesystem-7.1-2.fc6.noarch.rpm
· rpm -ivh libXau-1.0.3-1.fc7.i386.rpm
· rpm -ivh libXdmcp-1.0.2-2.fc7.i386.rpm
· rpm -ivh libX11-1.0.3-7.fc7.i386.rpm
· rpm -ivh libXext-1.0.1-2.1.i386.rpm
· rpm -ivh libXft-2.1.8.2-3.2.i386.rpm
· rpm -ivh libXrender-0.9.2-1.fc7.i386.rpm
· rpm -Fvh pango-1.15.5-1.fc7.i386.rpm
· rpm -Fvh libgcj-4.1.1-55.i386.rpm
· rpm -Fvh libobjc-4.1.1-55.i386.rpm
· rpm -ivh gcc-objc-4.1.1-55.i386.rpm

Any suggestions as to a build environment that will work for this? I can't fathom why it would just suddenly bail on that particular line of code. Do I need some additional "configure" flags? Should I be pointing configure to a different location? What gives?

rahulk 02-08-2007 01:23 PM

Quote:

Originally Posted by gdeckler
I am trying to get mod_jk to work with an Apache 2.2 implementation and having zero luck.

I am looking for either a mod_jk compiled for Apache 2.2 or for help with compiling mod_jk (details below).

My environment is RedHat ES4 on i386 architecture. I am using XAMPP 1.5.3a with Apache 2.2.2 and have the appropriate XAMPP devel package installed as well.

I have been out to the Tomcat Connectors website and downloaded the latest binaries for Linux and they do not work. Essentially "garbled DSO" errors.

Tomcat Connectors FAQ states that mod_jk works with Apache 2.2 but that you need a .so that is compiled for 2.2.

Any assistance is greatly appreciated as I am up against a wall to get this working.

Here are my Compile Details:

Downloaded mod_jk source

./configure --with-apxs2=/opt/lampp/bin/apxs --with-apache=/usr/local/src/lampp/

This works, then "make" gives:

...
gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -g -O2 -I /include -I /include/ -c jk_status.c -o jk_status.o >/dev/null 2>&1
make[1]: Leaving directory `/home/gdeckler/tomcat-connectors-1.2.20-src/native/common'
Making all in apache-2.0
make[1]: Entering directory `/home/gdeckler/tomcat-connectors-1.2.20-src/native/apache-2.0'
/bin/sh ../libtool --mode=compile gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -g -O2 -c mod_jk.c -o mod_jk.lo
mkdir .libs
gcc -I/usr/local/src/lampp//include -I/usr/local/src/lampp//srclib/apr/include -I/usr/local/src/lampp//os/unix -I/usr/local/src/lampp//srclib/apr-util/include -g -O2 -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -g -O2 -c mod_jk.c -fPIC -DPIC -o .libs/mod_jk.o
In file included from /usr/local/src/lampp//include/ap_config.h:25,
from mod_jk.c:29:
/usr/local/src/lampp//include/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t'
In file included from mod_jk.c:32:
/usr/local/src/lampp//include/apr_file_info.h:204: error: expected specifier-qualifier-list before 'apr_off_t'
In file included from mod_jk.c:33:
/usr/local/src/lampp//include/apr_file_io.h:548: error: expected declaration specifiers or '...' before 'apr_off_t'
/usr/local/src/lampp//include/apr_file_io.h:740: error: expected declaration specifiers or '...' before 'apr_off_t'
In file included from /usr/local/src/lampp//include/httpd.h:53,
from mod_jk.c:34:
...

I checked where things start to go wrong:
/usr/local/src/lampp//include/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t'

and line 270 of apr.h is the typdef off64_t line below:

typedef size_t apr_size_t;
typedef ssize_t apr_ssize_t;
typedef off64_t apr_off_t;
typedef socklen_t apr_socklen_t;

Which doesn't look particularly heinous.

Here is my environment

RedHat ES4 OS
i386 environment

My build environment:

· Download: glibc-kernheaders-3.0-5.2.i386.rpm
· Download: glibc-common-2.5.90-16.i386.rpm
· Download: glibc-2.5.90-16.i386.rpm
· Download: glibc-headers-2.5.90-16.i386.rpm
· Download: binutils-2.17.50.0.9-1.i386.rpm
· Download: glibc-devel-2.5.90-16.i386.rpm
· Download: libgomp-4.1.1-55.i386.rpm
· Download: libgcc-4.1.1-55.i386.rpm
· Download: cpp-4.1.1-55.i386.rpm
· Download: gcc-4.1.1-55.i386.rpm
· Download: libstdc++-4.1.1-55.i386.rpm
· Download: libstdc++-devel-4.1.1-55.i386.rpm
· Download: gcc-c++-4.1.1-55.i386.rpm
· Download: libpng-1.2.8-2.2.1.i386.rpm
· Download: cairo-1.3.12-1.fc7.i386.rpm
· Download: glib2-2.12.9-3.fc7.i386.rpm
· Download: libthai-0.1.7-5.fc7.i386.rpm
· Download: filesystem-2.4.1-1.i386.rpm
· Download: xorg-x11-filesystem-7.1-2.fc6.noarch.rpm
· Download: libXau-1.0.3-1.fc7.i386.rpm
· Download: libXdmcp-1.0.2-2.fc7.i386.rpm
· Download: libX11-1.0.3-7.fc7.i386.rpm
· Download: libXext-1.0.1-2.1.i386.rpm
· Download: libXft-2.1.8.2-3.2.i386.rpm
· Download: libXrender-0.9.2-1.fc7.i386.rpm
· Download: pango-1.15.5-1.fc7.i386.rpm
· Download: libgcj-4.1.1-55.i386.rpm
· Download: libobjc-4.1.1-55.i386.rpm
· Download: gcc-objc-4.1.1-55.i386.rpm

· rpm -ivh glibc-kernheaders-3.0-5.2.i386.rpm
· rpm –Fvh glibc*
· rpm -ivh glibc-headers-2.5.90-16.i386.rpm
· rpm -Fvh binutils-2.17.50.0.9-1.i386.rpm
· rpm -ivh glibc-devel-2.5.90-16.i386.rpm
· rpm -ivh libgomp-4.1.1-55.i386.rpm
· rpm -Fvh libgcc-4.1.1-55.i386.rpm
· rpm -ivh cpp-4.1.1-55.i386.rpm
· rpm -ivh gcc-4.1.1-55.i386.rpm
· rpm -Fvh libstdc++-4.1.1-55.i386.rpm
· rpm -ivh libstdc++-devel-4.1.1-55.i386.rpm
· rpm -ivh gcc-c++-4.1.1-55.i386.rpm
· rpm -Fvh libpng-1.2.8-2.2.1.i386.rpm
· rpm -ivh --nodeps cairo-1.3.12-1.fc7.i386.rpm
· rpm -Fvh glib2-2.12.9-3.fc7.i386.rpm
· rpm -ivh libthai-0.1.7-5.fc7.i386.rpm
· rpm -Fvh filesystem-2.4.1-1.i386.rpm
· rpm -ivh xorg-x11-filesystem-7.1-2.fc6.noarch.rpm
· rpm -ivh libXau-1.0.3-1.fc7.i386.rpm
· rpm -ivh libXdmcp-1.0.2-2.fc7.i386.rpm
· rpm -ivh libX11-1.0.3-7.fc7.i386.rpm
· rpm -ivh libXext-1.0.1-2.1.i386.rpm
· rpm -ivh libXft-2.1.8.2-3.2.i386.rpm
· rpm -ivh libXrender-0.9.2-1.fc7.i386.rpm
· rpm -Fvh pango-1.15.5-1.fc7.i386.rpm
· rpm -Fvh libgcj-4.1.1-55.i386.rpm
· rpm -Fvh libobjc-4.1.1-55.i386.rpm
· rpm -ivh gcc-objc-4.1.1-55.i386.rpm

Any suggestions as to a build environment that will work for this? I can't fathom why it would just suddenly bail on that particular line of code. Do I need some additional "configure" flags? Should I be pointing configure to a different location? What gives?

Firstly, Redhat does not suggest anyone to re-compile Apache webserver on any of its version. You can make jk-plugin work without compiling it on the http instance.

You only require the RPM to install the mod_jk plugin.


Keep the JK module (.so) file in the modules directory and add the following in httpd.conf

LoadModule jk_module /etc/httpd/modules/mod_jk.so

Then the idea of making the JK mount work is to keep it out of <VirtualHost> section.

Create the workers.properties file and use the following directives for that

JkLogFile <log location>
JkLogLevel error
JkWorkersFile /etc/intra_httpd/conf/workers.properties
JkShmFile <location>/jk.shm ##REQUIRED

JkMount /dummy app name/* <JK worker thread>

worker.properties file should look like:-

worker.list=<JK worker thread>
worker.<JK worker thread>.port=<port>
worker.<JK worker thread>.host=<Tomcat server name>
worker.<JK worker thread>.type=ajp13

That should work!! Let me know what problem do you face.

Best Regards,
Rahul.

gdeckler 02-08-2007 02:08 PM

I've since scrapped this and decided to just use mod_proxy_ajp for right now. But I did try the rpm package thus:

rpm -ivh --nodeps mod_jk-1.2.6-3jpp_4fc.i386.rpm --with apache2

garbled .so

and then

rpm -e --allmatches mod_jk
rpm -ivh --nodeps mod_jk-1.2.6-3jpp_4fc.i386.rpm --define='apxs /opt/lampp/bin/apxs'

garbled .so

and then

rpm -e --allmatches mod_jk
rpm -ivh --nodeps mod_jk-1.2.6-3jpp_4fc.i386.rpm --define='apxs /opt/lampp/bin/apxs' --with apache2

garbled .so

and then

rpm -e --allmatches mod_jk
rpm -ivh --nodeps mod_jk-1.2.6-3jpp_4fc.i386.rpm --with apache2.2

garbled .so

So rpm package does not seem to be the answer. The answer seems to be that mod_jk is dead for Apache > 2.0 and that instead you should use mod_proxy_ajp so I'm going to give that a try.

Thanks for the response and help.


All times are GMT -5. The time now is 11:55 PM.