[Centos] Help: Apache2, Tomcat5 and jk2_connector
Troy Engel
tengel at fluid.com
Mon Dec 6 17:59:46 UTC 2004
Hi Fernando,
I don't use Tomcat5.5 yet in any project (soon!), but in order to do it
with Tomcat4.1 I use the following steps -- I'll include mod_jk as well
as mod_jk2, since I think mod_jk is more stable. (mod_jk also has a
higher performance under heavy load than mod_jk2 once you hit around 75
concurrent threads):
- I don't use j2sdk via RPM, but instead run the non-RPM shellscript
installer version, and use symlinks. So, to get java use:
1. cd /usr/local
2. sh /path/to/download/j2sdk-1_4_2_06-linux-i586.bin
3. [answer yes and let it unpack]
4. ln -s j2sdk1.4.2_06 java
5. cd /usr/local/bin
6. ln -s ../java/j* .
7. rm -f /usr/bin/java* <- symlinks installed by libgcj, ugh
- Now untar your tomcat, let's say again to /usr/local:
1. cd /usr/local
2. tar -zxf /path/to/jakarta-tomcat-4.1.31.tar.gz
3. ln -s jakarta-tomcat-4.1.31 tomcat
- Now you can build the connectors, both mod_jk and mod_jk2. Using the
psuedo paths above, it's like:
A) mod_jk
1) untar jakarta-tomcat-connectors-{ver}-src.tar.gz
2) cd jakarta-tomcat-connectors-{ver}-src/jk/native
3) ./configure --with-apxs=/usr/sbin/apxs --with-java=/usr/local/java
4) make
5) output is in ./apache-2.0/mod_jk.so
B) mod_jk2
1) untar jakarta-tomcat-connectors-{ver}-src.tar.gz
2) cd jakarta-tomcat-connectors-{ver}-src/jk/native2
3) sed
"s|LIBTOOL=\${APACHE2_HOME}/build/libtool|LIBTOOL=../../libtool|g" <
./server/apache2/Makefile.in > temp.in && mv temp.in
./server/apache2/Makefile.in
4) ./configure \
--with-apxs2=/usr/sbin/apxs \
--with-tomcat41=/usr/local/tomcat \
--with-java-home=/usr/local/java
5) make
6) output is in ../build/jk2/apache2/mod_jk2.so
The last thing you need to do is connect all the pieces. First, you need
to include one of the two configs below into apache (Include
/path/to/file), depending on which connector you want to use:
mod_jk.conf
===========
LoadModule jk_module /path/to/mod_jk.so
JkWorkersFile /path/to/workers.properties
JkLogFile /path/to/mod_jk.log
JkLogLevel error
JkMount /*.jsp ajp13
(add as many JkMounts as needed)
mod_jk2.conf
============
LoadModule jk2_module /path/to/mod_jk2.so
JkSet config.file /path/to/workers2.properties
Of course, you need to create/modify the workers(2).properties files to
suit your needs, and for mod_jk2 you *must* put 'jk2.properties' in the
tomcat/conf/ subfolder, appropriately edited as well.
In theory most of this should work with Tomcat5.5, but as mentioned I
haven't had a chance to go there yet.
-te
Fernando Mustieles wrote:
> Hello, Does any have Apache 2.0.49 with tomcat 5.5.4
> and jakarta-tomcat-connectors-jk2-2.0.4 working???
>
> Apache was allready installed with CentOS 3
> I installed tomcat with it's tar.gz file and
> instalation was good.
> but I installed first the j2sdk-1_4_2_06-linux-i586
> java version...
> everything was OK...
>
> but when I try to install the jakarta-tomcat-connector
> I get an error when executing the make command...
>
> ./configure (with parameters) work ok, with no error..
>
> but with make I got the following:
>
> # make
> list=' server/apache2'; \
> for i in $list; do \
> echo "Making $target in $i"; \
> if test "$i" != "."; then \
> (cd $i && make) || exit 1; \
> fi; \
> done;
> Making in server/apache2
> make[1]: Entering directory
> `/home/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/server/apache2'
> mkdir -p
> ../../../build/jk2/apache2/usr/lib/httpd/modules
> /bin/sh /usr/bin/libtool --silent --mode=compile gcc
> -O2 -g -pipe -march=i386 -mcpu=i686
> -DSSL_EXPERIMENTAL_
> ENGINE -I/usr/kerberos/include -pthread -DLINUX=2
> -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
> -D_SVID_SO
> URCE -D_GNU_SOURCE -I../../include
> -I/usr/include/httpd
> -I/rpmbuild/centos/rpm/BUILD/httpd-2.0.46/prefork/sr
> clib/apr-util/include
> /rpmbuild/centos/rpm/BUILD/httpd-2.0.46/srclib/apr-util/include
> -I/rpmbuild/centos/rpm/B
> UILD/httpd-2.0.46/prefork/srclib/apr/include
> /rpmbuild/centos/rpm/BUILD/httpd-2.0.46/srclib/apr/include
> -I /us
> r/java/j2sdk1.4.2_06/include -I
> /usr/java/j2sdk1.4.2_06/include/linux
> -DCHUNK_SIZE=4096 -DUSE_APACHE_MD5 -DHA
> VE_JNI -c ../../common/jk_channel_apr_socket.c -o
> ../../../build/jk2/apache2/jk_channel_apr_socket.lo
> gcc: cannot specify -o with -c or -S and multiple
> compilations
> make[1]: ***
> [../../../build/jk2/apache2/jk_channel_apr_socket.lo]
> Error 1
> make[1]: Leaving directory
> `/home/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/server/apache2'
> make: *** [jk2-build] Error 1
>
>
> Any ideas of the problem and how to fix it....
> or should I use another versions of tomcat and the
> connector.
>
> In advance thanks for your help...
>
>
>
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at caosity.org
> http://lists.caosity.org/mailman/listinfo/centos
--
Troy Engel | Systems Engineer
Fluid, Inc | http://www.fluid.com
More information about the CentOS
mailing list