Installing Tomcat and JDK

Links to download

Apache-Tomcat ==> http://tomcat.apache.org/download-60.cgi

JDK ==> http://java.sun.com/javase/downloads/index_jdk5.jsp

Installing JDK

1. Download JDK rpm (the file would be with rpm.bin extension on the provided link)

2. Give the bin file executable permission --

Code:
# chown u+x jdk.xxx.xxx.rpm.bin



3. Execute the bin file, it will install the jdk rpm in one go

Code:
# ./jdk.xxx.xxx.rpm.bin

4. JDK by default intalls itself in /usr/java directory

5. Now need to unlink older java and link new java for that

Code:
# unlink /usr/bin/java
# ln -s /usr/java/jdk.version/bin/java /usr/bin/java


6. Now check java version

Code:
# java -version

7. Export the java path in bashrc file

Code:
export JAVA_HOME=/usr/java/jdk1.5.0_22/
export PATH=$PATH:$JAVA_HOME/bin




Installating Apache-Tomcat



1. We will take example of Tomcat 6.0

2. Create user tomcat

Code:
# useradd tomcat

3. Download Tomcat 6.0 gunzipped(tar.gz) packageand Extarct it to tomcat home directory.

4. After that you will get a directory named apache-tomcat-6.xx.xx.

Code:
# cd apache-tomcat-6.xx.xx.
# ls
bin conf D: lib LICENSE logs NOTICE RELEASE-NOTES RUNNING.txt temp webapps work


5. Give tomcat ownership to apache-tomcat-6.xx.xx directory.

6. Export java paths to tomcat home directory.

Code:
# vi /home/tomcat/.bashrc

7. Enter the following line in .bashrc file

Code:
export JAVA_HOME=/usr/java/jdk1.5.0_22/
export PATH=$PATH:$JAVA_HOME/bin


8. Now we need to make start and stop script for tomcat.

Code:
# vi start_tomcat_6.sh

9. Add the following line to this file

Code:
CATALINA_BASE=/home/tomcat/apache-tomcat-6.xx.xx
CATALINA_HOME=/home/tomcat/apache-tomcat-6.xx.xx
CATALINA_TMPDIR=/home/tomcat/apache-tomcat-6.xx.xx/temp
JRE_HOME=/usr/java/jdk1.5.0_22/

export CATALINA_BASE
export CATALINA_HOME
export CATALINA_TMPDIR
export JRE_HOME

sh $CATALINA_HOME/bin/startup.sh


10. Save and exit

Code:
# vi stop_tomcat_6.sh

-- Add the following line

Code:
CATALINA_BASE=/home/tomcat/apache-tomcat-6.0.29
CATALINA_HOME=/home/tomcat/apache-tomcat-6.0.29
CATALINA_TMPDIR=/home/tomcat/apache-tomcat-6.0.29/temp
JRE_HOME=/usr/java/jdk1.5.0_22/

export CATALINA_BASE
export CATALINA_HOME
export CATALINA_TMPDIR
export JRE_HOME

sh $CATALINA_HOME/bin/shutdown.sh

11. Put these scripts in tomcat user's home directory and give ownership of tomcat user.

12. Now login as tomcat user and run the start script

Code:
# su – tomcat
# ./start_tomcat_6.sh


13. It will give a long output and will take a while to start.

14. To check tomcat is running or not open the webbrowser and enter

http://localhost:8080

15. To check from other machines enter the IP of the machine with 8080 port

16. To stop tomcat run the stop script

Code:
# ./stop_tomcat_6.sh

Comments

Popular posts from this blog

28 Names of Srimati Radha Rani (Hindi/Odia/English)