Sunday, January 1, 2012

Install Tomcat to Amazon EC2 instance

To install Tomcat, first we need to install a JDK. Steps to install JDK.
  1. Login to AWS EC2 instance with putty.
  2. sudo su
  3. Create a directory for Java installation. cd /usr/share, mkdir java, cd java.
  4. Download a JDK from Oracle.  wget 
  5. Install it. tar -xzf jdk-7u2-linux-i586.tar.gz
  6. Test it. /usr/share/java/ jdk1.7.0_02/bin/java -version.
Install Tomcat.
  1. Download Tomcat to /usr/share directory. wget
  2. Install Tomcat. tar -xzf apache-tomcat-7.0.23.tar.gz
  3. set JAVA_HOME $env in cd /usr/share/apache-tomcat-7.0.23/bin,
    vi and add following line after the first line. JAVA_HOME=/usr/share/java-1.7.0/jdk1.7.0_02
  4. Start it. ./ Check log and fix errors if any.
Next I will talk about creating a startup/shutdown script.

No comments:

Post a Comment