I have installed Amazon EC2 instance and have set up tomcat7 on it with sudo yum install tomcat7
command. Also I have added a rule
8080 0.0.0.0/0
in instance's security group.
Also I ran tomcat7 service and now
$ service tomcat7 status
tomcat7 (pid 3979) is running... [ OK ]
But I still cannot access tomcat's greeting page:
$ wget http://localhost:8080
--2012-05-21 19:33:56-- http://localhost:8080/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-05-21 19:33:56 ERROR 404: Not Found.
What else should be done?
REMOTE ACCESS
Also I get "network unreacheable" error while trying to access the server from my home computer.
>wget http://<DNS>.amazonaws.com:8080
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:/progra~1/wget/etc/wgetrc
--2012-05-21 23:37:35-- http://<DNS>.amazonaws.com:8080/
Resolving <DNS>.amazonaws.com... xxx.xx.xxx.xxx
Connecting to <DNS>.amazonaws.com|<IP>|:8080... failed: Network is unreachable.
Given that you're running wget locally from the ec2 instance itself, the security group is of no significance. The fact that you're getting a 404 implies that tomcat is indeed serving your request. It is another matter that tomcat is returning a Page Not Found error.
Two things: 1) For local access to an ec2 instance (from the instance itself that is), security groups do not have any significance. And there you are clearly able to reach tomcat. Just that tomcat is returning a 404 Not Found instead of the greeting page.
2) Remote access is controlled by security group. But given that you're seeing a Netwok Unreachable error, it looks like a routing table issue.
Is the firewall ( IPTables ) configured to allow connections to 8080 ? Try disabling iptables and see if its accessible.
Check your firewall rules. Redhat won't allow this port by default, while the Amazon linux AMI does allow it.
If you're running redhat, try running this command to config the firewall:
Hi Tomcat is installed and its up and running thats why you got 404 error and why you are not getting admin page is because its web app files are not installed so run following command you will get tomcat admin page.
sudo yum install tomcat6-webapps tomcat6-docs-webapp tomcat6-admin-webapps