Installing JDK, Tomcat on EC2 Fedora Core 8 instance

  • Download JDK to say /mnt/downloads/

wget -O jdk1.6.bin http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586.bin?BundledLineItemUUID=uyNIBe.lLxwAAAEjdGQlL7Q3&OrderID=FE1IBe.lTu8AAAEjZGQlL7Q3&ProductID=Dx1IBe.prBgAAAEirRcTvuC_&FileName=/jdk-6u16-linux-i586.bin

  • cd /usr/local/
  • sh /mnt/downloads/jdk1.6.bin
  • mv jdk1.6.0_16/ jdk1.6
  • vi /etc/profile

export JAVA_HOME=/usr/local/jdk1.6
export PATH=$PATH:$JAVA_HOME/bin

  •  Download Tomcat to say /mnt/downloads

wget http://www.gtlib.gatech.edu/pub/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz

  • tar -zxvf apache-tomcat-6.0.20.tar.gz
  • mv apache-tomcat-6.0.20 /usr/local/tomcat6
  • useradd -d /home/tomcat -s /bin/bash -m tomcat
  • chown -R tomcat:tomcat /usr/local/tomcat6/
  • test using commans: su – tomcat -c /usr/local/tomcat6/bin/startup.sh
  • shutdown:  su – tomcat -c /usr/local/tomcat6/bin/shutdown.shconfigure the startup script

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

Advertisements