0
votes

I am new to AWS EC2. I created a RedHat instance and it was running fine and was able to see tomcat home page at http://ec2-52-41-9-150.us-west-2.compute.amazonaws.com:8080 until I installed various packages for GUI and RDP.

Now I can RDP RedHat instance, but from my local computer browser http://ec2-52-41-9-150.us-west-2.compute.amazonaws.com:8080 giving me

  The connection has timed out , The server at ec2-52-41-9-150.us-west-2.compute.amazonaws.com is taking too long to respond 

response.

My doubt is installing various GUI packages can block access to 8080 port on RedHat instance ?

I have following security groups

 Type               Protocol     Port  Source

 HTTP                TCP         80      0.0.0.0/0
 Custom TCP Rule     TCP         8080    0.0.0.0/0
 SSH                 TCP         22      0.0.0.0/0
 RDP                 TCP         3389    0.0.0.0/0
 HTTPS               TCP         443     0.0.0.0/0

Through SSH, I did

[ec2-user@ip-172-31-18-185 ~]$ sudo service tomcat status
    Redirecting to /bin/systemctl status  tomcat.service
    ● tomcat.service - Apache Tomcat Web Application Container
    Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
      Active: active (running) since Sun 2016-07-03 07:26:24 EDT; 1h 23min ago
    Main PID: 745 (java)
    CGroup: /system.slice/tomcat.service
       └─745 /usr/lib/jvm/jre/bin/java -classpath /usr/share/tomcat/bin/b...

and

[ec2-user@ip-172-31-18-185 ~]$ netstat -lnt
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State
  tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN
  tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
  tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
  tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN
  tcp6       0      0 :::8009                 :::*                    LISTEN
  tcp6       0      0 :::3306                 :::*                    LISTEN
  tcp6       0      0 :::8080                 :::*                    LISTEN
  tcp6       0      0 :::22                   :::*                    LISTEN
  tcp6       0      0 ::1:631                 :::*                    LISTEN
  tcp6       0      0 ::1:25                  :::*                    LISTEN
  tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN

and

[ec2-user@ip-172-31-18-185 ~]$ curl localhost:8080
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I am getting my html page fine when I did curl. What could be the possible reason, Why I am getting Connection time out error and not able to see my tomcat homepage in my PC browser?

Any guess / idea is helpful. Thanks. Btw, I stopped, started, rebooted my instance several times before I am posting this question.

1
tried this one too... [root@ip-172-31-18-185 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service Failed to stop iptables.service: Unit iptables.service not loaded.eaglerider

1 Answers

1
votes

First check your tomcat configuration under

tomcat/conf/server.xml

maybe it is configured to listen only to the localhost, If that is not the case check your VPC settings, Maybe they don't allow to be accessible publicly.