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


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...
Connecting to localhost||: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?


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.
  • Do you see any entries in tomcat's access log? – Andrew M. May 21 '12 at 19:56

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.

| improve this answer | |

Is the firewall ( IPTables ) configured to allow connections to 8080 ? Try disabling iptables and see if its accessible.

| improve this answer | |

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:

| improve this answer | |

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

| improve this answer | |
  • Since Suzan is running Tomcat 7, those packages should probably for Tomcat 7, not 6. – asciiphil Dec 21 '13 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.