Welcome to Srini's blog

Tuesday, December 1, 2009

How to install native tomcat in LINUX

Steps to install native Tomcat in Linux :
1. First download latest native tomcat(tomcat-native-1.1.18-src.tar.gz) src from http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/source/
2. Create temp location(eg. /tmp/tomcat) and copy downloded src into this folder
3. Run the following cmd to untar --> tar -xzvf tomcat-native-1.1.18-src.tar.gz
4. go to /tomcat-native-1.1.18-src/jni/native and run the cmd --> ./configure && make
5. It may propmt you an error as "apr is not located" and suggest give the cmd as --with-apr=APRDIR
The error because of apr is not installed in system. So now Install latest apr
Steps to Install apr :
6. Download latest apr(apr-1.3.9.tar.gz) src from
http://apache.opensourceresources.org/apr/
7. copy apr src into temp location(/tmp/tomcat).
8. Run the following cmd to untar --> tar -xzvf apr-1.3.9.tar.gz
9. Go to /apr-1.3.9 and run the cmd --> ./configure && make && make install.
So, apr installation completed. Now try to install native tomcat
10. go to /tomcat-native-1.1.18-src/jni/native and run the cmd --> ./configure && make
11. It may prompt you an error as "JDK is not located".
The error because of jdk is not installed in system(we need JDK to compile native
tomcat).So install latest JDK
Steps to install JDK :
12. Download latest JDK(jdk-6u17-linux-i586.bin) from http://java.sun.com/javase/downloads/index.jsp
13. Copy downloaded JDk into /usr/java(If location is not existed, create it and copy it).
14. Go to /usr/java and give permissions to jdk-6u17-linux-i586.bin file --> chmod 755 jdk-6u17-linux-i586.bin
15. install JDK using cmd --> ./jdk-6u17-linux-i586.bin
16. Follow the instructions carefully and install JDK.
17. If JDK installed successfully u can see 'jdk1.6.0_17' folder in /usr/java/.
18. Set java home path using cmds
i. JAVA_HOME="/usr/java/jdk1.6.0_17/"
ii. export JAVA_HOME.
So, JDK installation completed. Now try to install native tomcat.
19. go to /tomcat-native-1.1.18-src/jni/native and run the cmd --> ./configure && make.
20.Native tomcat installation completed successfully.

If you have any doubts/clarifications please let me know.

2 comments:

  1. very very helpful. i really got my jdk start working through this tutorial. thanks.

    ReplyDelete