I have installed the tomcat and Java on my Amazon EC2 Instance by followingthe instructions on the following tutorial. http://sites.google.com/site/amistrongeryet/setting-up-java-tomcat-on-ec2. But after installing when I run the "updatedb; locate javac | grep bin" command it did not recognize the update and locate command and gives me the error message locate: command not found and after installing the tomcat everything went sommoth during installation according to the instructions in above mentioned tutorial but at the end when I run the command "bin/startup.sh" and try to navigate the url http://my_public_dns_key:8080 it gives me the connection timed out error.
Also please find below the command reference for my linux commands that I am using to run Java and tomcat.
Command References:
[ec2-user@domU-12-31-39-09-D1-AA ~]$ cd /env/tomcat/
[ec2-user@domU-12-31-39-09-D1-AA tomcat]$ ls
apache-tomcat-6.0.33 apache-tomcat-6.0.33.tar.gz
[ec2-user@domU-12-31-39-09-D1-AA tomcat]$ cd apache-tomcat-6.0.33
[ec2-user@domU-12-31-39-09-D1-AA apache-tomcat-6.0.33]$ sudo bin/startup.sh
Using CATALINA_BASE: /env/tomcat/apache-tomcat-6.0.33
Using CATALINA_HOME: /env/tomcat/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /env/tomcat/apache-tomcat-6.0.33/temp
Using JRE_HOME: /usr
Using CLASSPATH: /env/tomcat/apache-tomcat-6.0.33/bin/bootstrap.jar
[ec2-user@domU-12-31-39-09-D1-AA apache-tomcat-6.0.33]$ rpm -q tomcat
package tomcat is not installed
[ec2-user@domU-12-31-39-09-D1-AA apache-tomcat-6.0.33]$ cd /usr/local/java/
[ec2-user@domU-12-31-39-09-D1-AA java]$ ls
jdk-6u20-ea-bin-b02-linux-amd64-01_apr_2010-rpm.bin sun-javadb-client-10.5.3-0.2.i386.rpm sun-javadb-core-10.5.3-0.2.i386.r
jdk-6u20-ea-linux-amd64.rpm sun-javadb-common-10.5.3-0.2.i386.rpm sun-javadb-demo-10.5.3-0.2.i386.r
[ec2-user@domU-12-31-39-09-D1-AA java]$ cd env/tom
-bash: cd: env/tom: No such file or directory
[ec2-user@domU-12-31-39-09-D1-AA java]$ cd /env/tomcat/
[ec2-user@domU-12-31-39-09-D1-AA tomcat]$ cd apache-tomcat-6.0.33
[ec2-user@domU-12-31-39-09-D1-AA apache-tomcat-6.0.33]$ sudo bin/startup.sh
Using CATALINA_BASE: /env/tomcat/apache-tomcat-6.0.33
Using CATALINA_HOME: /env/tomcat/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /env/tomcat/apache-tomcat-6.0.33/temp
Using JRE_HOME: /usr
Using CLASSPATH: /env/tomcat/apache-tomcat-6.0.33/bin/bootstrap.jar
[ec2-user@domU-12-31-39-09-D1-AA apache-tomcat-6.0.33]$
Please provide any help that you can provide and help me to sort the issue out. Thanks in advance.
Best Answer
Here are the steps I documented for myself in setting up java and tomcat in a 32 bit small instance. (lame that they support 32/64 bit on micro, but only 32 bit on small!)
Installing Tomcat
I later change it to use sudo wget http://apache.tradebit.com/pub/tomcat/tomcat-7/v7.0.16/bin/apache-tomcat-7.0.16.tar.gz
At this point, you should be able to hit http:/// and get the tomcat management page.
Installing Sun JDK 6 Download Sun JDK 6. You must agree to the terms and conditions in order to download, so I think you'll have to download and then sftp it over. I downloaded from http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html the 32 bit .bin version.
unzip the jdk into /opt/jdk1.6.xxx and then install it as a java alternative using the following:
Then make sure you are running java by checking java -version. Since tomcat will be starting as root, I used sudo to test it.