Installation of java and Apache-tomcat on Linux
1.Introduction
2.Installation of java
3.Installation of apache tomcat
4.References
1.Introduction:
This document is meant for the installation of java and apache-tomcat
over a linux machine.
2.Installation of java
Download the JDK from Sun, to start go here:
http://java.sun.com/javase/downloads/index.jsp
Click on the “Download” link in the JDK section.
Accept the license and continue.
Under the “Linux Platform”, select “rpm self-extracting file”.
Download this .bin file and save it to your Linux machine.
become root, and give command chmod 755 downloaded_bin_file for
instance “chmod 755 jdk-6u2-linux-i586.bin”
now execute file with command ./downloaded_bin_file
Accept the license after scrolling down on the terminal. This will
give a .rpm file in the same directory.
install the extracted .rpm file with rpm -ivh extracted_file.rpm
Set the path of java
To set the path of java edit /etc/profile file and add the following lines
JAVA_HOME=/usr/java/jdk1.5.0_09
export PATH=$PATH:$JAVA_HOME/bin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME
Note: Here rpm file installed java in /usr/java/jdk1.5.0_09 choose the
path name as per your installation version.
Now give command “source /etc/profile”
check the path by giving command
[root@anuj2 ~]# echo $JAVA_HOME
/usr/java/jdk1.5.0_09
3.Installation of apache-tomcat
Download apache-tomcat from
http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/
tar zxvf apache-tomcat-5.5.25.tar.gz
cd apache-tomcat-5.5.25/bin
[root@anuj2 bin]# sh startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-5.5.25
Using CATALINA_HOME: /usr/local/apache-tomcat-5.5.25
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.25/temp
Using JRE_HOME: /usr/java/jdk1.5.0_09
Automatic startup of apache-tomcat at boot time(Redhat Linux):
Save following script in /etc/init.d/ directory with tomcat name
Note: Use correct path of catalina.sh in PROGRAM
#!/bin/sh
# chkconfig: – 85 15
# description: Tomcat is a servlet container
#PROGRAM=$CATALINA_HOME/bin/catalina.sh
PROGRAM=/usr/local/apache-tomcat-5.5.25/bin/catalina.sh
if [ -f $PROGRAM ]; then
echo “$1ing” `basename $0`
su – root -c “$PROGRAM $1″
fi
Now use following commands
“chmod 755 /etc/init.d/tomcat”
“chkconfig –add tomcat ”
“chkconfig –level 345 tomcat on”
“service tomcat start”
4.References:
http://apache.org/
http://tech.groups.yahoo.com/group/lucknow-lug/