I am a Java application developer and know little about Linux configuration.
I am trying to install Java and Tomcat in a new instance of Redhat on Amazon EC2 and execute the below script.
mkdir /usr/local/java cd /usr/local/java curl http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.rpm > jdk.rpm rpm -iv jdk.rpm updatedb; locate javac | grep bin
At this point, it is expected that http://ec2-23-20-24-96.compute-1.amazonaws.com:8080/ will return the Tomcat homepage, but this did not happen :(
cd /etc/rc.d/init.d/ vi tomcat
I pasted the contents below into a file:
#!/bin/sh
Then runs:
chmod 755 /etc/rc.d/init.d/tomcat chkconfig --level 2345 tomcat on export JAVA_HOME=/usr/java/jdk1.7.0_02 export PATH=$PATH:/usr/java/jdk1.7.0_02 export CATALINA_HOME=/env/tomcat/apache-tomcat-7.0.23 /env/tomcat/apache-tomcat-7.0.23/bin/shutdown.sh /env/tomcat/apache-tomcat-7.0.23/bin/startup.sh
Nowhere did I get any errors, but I also could not get the Tomcat main page. Can you indicate where I was wrong.
thanks
James
EDIT:
Tomcat Log (on the Stop and Start Server)
Jan 18, 2012 2:06:48 AM org.apache.catalina.core.StandardServer await INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8080"] Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] Jan 18, 2012 2:06:48 AM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8080"] Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"] Jan 18, 2012 2:08:46 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib Jan 18, 2012 2:08:46 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] Jan 18, 2012 2:08:46 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Jan 18, 2012 2:08:46 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 530 ms Jan 18, 2012 2:08:46 AM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Jan 18, 2012 2:08:46 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.23 Jan 18, 2012 2:08:46 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/examples Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/host-manager Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/manager Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/docs Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/ROOT Jan 18, 2012 2:08:47 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Jan 18, 2012 2:08:47 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 583 ms
EDIT2:
My problem is similar to the problem https://forums.aws.amazon.com/thread.jspa?threadID=59937 , but this does not provide a solution.
I executed wget and I got the correct index.html with the Tomcat html main page.
wget http://ec2-23-20-24-96.compute-1.amazonaws.com:8080
I have two security groups - default and quick start-1, and I added ports 80 and 8080 to the list.