Performance Blog

Building mod_jk

Posted on: May 9, 2007

Here are the instructions for building mod_jk.

1. Download the source and untar it.

2. Ensure you have Sun Studio compiler in your PATH followed by /usr/ccs/bin. Save the following in ‘make_solaris.sh’ in the ‘native’ directory :

#!/bin/sh
INSTALLDIR=/opt/coolstack
APACHEDIR=$INSTALLDIR/apache2
make distclean
PATH=$INSTALLDIR/bin:$PATH
export PATH
./configure –with-apxs=/opt/coolstack/apache2/bin/apxs –with-java-home=/usr/java –with-prefix=$INSTALLDIR
make
make install

3. Go to the ‘native’ directory and run ./make_solaris.sh

4. Edit your httpd.conf file to include :

  LoadModule jk_module        modules/mod_jk.so

5. Restart the apache httpd server.

Let me know if this doesn’t work for you.

Shanti

 

Advertisements

9 Responses to "Building mod_jk"

If you use apache 2.2, you don’t need mod_jk
any more. Use the apache 2.2 bundled mod_proxy_ajp instead.

mod_proxy_ajp/mod_proxy_balancer are bundled with httpd 2.2: They are easy to use and modproxy_balancer also supports http as a backend protocol.
On the other hand mod_jk added a lot of features in the last two years and supports much more complex backend topoloies. If you need to support a complex setup, you might still need to use mod_jk.

Unfortunately, the apache 2.2 bundled in the coolstack doesn’t have mod_proxy_ajp (or any of the mod_proxy modules AFAICT) installed.

Not Found
The requested URL /dist/tomcat/tomcat-connectors/jk/source/jk-1.2.22/tomcat-connectors-1.2.22-src.tar.gz was not found on this server.
Apache/2.3.0-dev (Unix) Server at http://www.apache.org Port 80

Couldn`t find 1.2.22, working with 1.2.23 :
/opt/coolstack/apache2/build/libtool –silent –mode=compile gcc -I/opt/coolstack/apache2/include -g -O2 -DSSL_EXPERIMENTAL -DSSL_ENGINE -O3 -DHAVE_APR -I/opt/coolstack/apache2/include -I/opt/coolstack/apache2/include -g -O2 -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE64_SOURCE -I /usr/java/include -I /usr/java/include/ -c jk_ajp12_worker.c -o jk_ajp12_worker.lo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `–tag’
*** Error code 1
make: Fatal error: Command failed for target `jk_ajp12_worker.lo’
Current working directory /root/mod_jk/tomcat-connectors-1.2.23-src/native/common
*** Error code 1

Which platform are you building on ? If on sparc, you need the Sun Studio 11 compilers in your PATH. On x86, you need /usr/sfw/bin in your PATH for gcc.
Shanti

I just rebuild the latest mod_jk (1.2.25) on x86 without any problems. I’ve updated the link to ‘source’ to just point to the source dir and explained what PATH should be. Most of the problems with builds seem to be incorrect compilers and/or PATHs. Ensure you have all of the patches for Studio as well. Alternatively, try using Studio 12 – that works as well.

I have downloaded tomcat-connectors-1.2.25-src.tar.gz from the link provided here
Here are environment details – Solaris 9 Sparc, apache 1.3 and Tomcat 4
In the make_solaris.sh i have modified the apache paths accordingly.
Sun studio 10 path comes before /usr/ccs/bin in PATH env variable.
Following things are failing
1. make distclean (Target is not available)
2. After removing the above line, configure command is not working. As a result no make files are generated.
I am new to C.
Please let me know if you want any more info.
Thanks in advance for the help
Vinay

I was wondering if you have such a good way to build mod_jk for Windows. I need to work on this and make a connector which delegates services to Tomcats not according to load but Primary-Secondary ways…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Pages

Latest Tweets

Categories

Archives

%d bloggers like this: