Installing Tomcat 6 on Fedora, Red Hat or CentOS

Install Tomcat using yum

# yum install tomcat6-webapps

Tomcat will get installed across the following directories

/etc/tomcat6             conf files     $CATALINA_HOME/conf
/usr/share/java/tomcat6  libs           $CATALINA_HOME/lib
/usr/share/tomcat6/bin   executables    $CATALINA_HOME/bin
/var/log/tomcat6         logs           $CATALINA_HOME/logs
/var/cache/tomcat6/temp  temp files     $CATALINA_HOME/temp
/usr/share/tomcat6       home directory $CATALINA_HOME
/var/lib/tomcat6/webapps web apps       $CATALINA_HOME/webapps
/var/cache/tomcat6/work  compiled stuff $CATALINA_HOME/work

Set CATALINA_HOME in /etc/profile

export CATALINA_HOME=/usr/share/tomcat6

Tomcat can be stopped, started and restarted using the following commands

# service tomcat6 stop
# service tomcat6 start
# service tomcat6 restart

Installing JDK on Fedora, Red Hat, CentOS

  1. Visit sun java website and select the  java JDK version you would like to install:
  2. Download the jdk-xxxxx-rpm.bin file using wget
  3. Make the downloaded file executable by running the following command
    # chmod +x jdk-xxxxx-rpm.bin   
  4. Install JDK by running the following command
    # rpm -i  jdk-xxxxx-rpm.bin  
  5. Create symbolic links for java and javac
    # ln -s /usr/java/jdkxxx/bin/java /usr/bin/java  
  6. ln -s /usr/java/jdkxxx/bin/javac /usr/bin/javac
  7. Setting JAVA_HOME and PATH for all users
    # vi /etc/profile  
    # export JAVA_HOME=/opt/jdkx.x.x_xx
    # export PATH=$PATH:$JAVA_HOME/bin