Tomcat 6 Intall

1:14 am Installations, Web

This is a step by step stand alone installation of Tomcat 6

JDK Install:

fetch JDK @ http://java.sun.com/

# sh jdk-6u4-linux-i586-rpm.bin
accept license

set java home and path:

# JAVA_HOME=/usr/java/jdk1.6.0_04/
# export JAVA_HOME
# PATH=$JAVA_HOME/bin:$PATH
# export PATH
# which java

Make it happen at boot time:

# cd /etc/profile.d
# vi
/etc/profile.d/jdk.sh

add the following lines to jdk.sh:

export JAVA_HOME=/usr/java/jdk1.6.0_04/ #(or the the location to java home if different)
export PATH=$JAVA_HOME/bin:$PATH

Installing Tomcat From Binary:

wget http://www.signal42.com/mirrors/apache/tomcat/tomcat-6/v6.0.16/bin/apache-tomcat-6.0.16.tar.gz
Untar:

# tar -zxvf apache-tomcat-6.0.16.tar.gz

Move it to /opt/ or desired location
# mv apache-tomcat-6.0.16 /opt/

For security, lets make it run under a underprivileged user:
# useradd tomcat -d /opt/apache-tomcat-6.0.16/temp/

Adjust permissions:
# chown -R tomcat:tomcat /opt/apache-tomcat-6.0.16/

Test install
[root@localhost opt]# sudo -u tomcat /opt/apache-tomcat-6.0.16/bin/startup.sh

or use startup script:

#vi /etc/init.d/tomcat

use the following script:

http://www.linuxzone.org/scripts/tomcat.txt

Add it to chkconfig and turn it on:

# chkconfig --add tomcat
# chkconfig tomcat on

That is it! Let me know if missed anything.

5 Responses

  1. Serge Says:

    Hi

    Thanks a lot for a very nice tutorial.
    Saved me time.
    those banners were clicked one by the way ;)

  2. PBSLuvr Says:

    Thanks for this tutorial.
    I used jdk6 update 6 and tomcat5.5.26.
    (RHEL 5)
    Even though I had set the JAVA_HOME environment variable, I had to add that variable definition in the catalina.sh script for tomcat to startup successfully.

  3. JC Lima Says:

    You are correct. I had a few typos. I have updated the tutorial so that you would not have to alter catalina.sh. At least not on a RedHat system.

    Also a few people were having problems copying and pasting the init script so I just put a link to the file.

    Let me know if you have any questions or if you guys find any more bugs.

    –JC

  4. John Says:

    Within your debug() function of the tomcat init script, you have an inconsistent path to catalina.sh

  5. JC Lima Says:

    Got it corrected. Thanks!

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.