【发布时间】:2016-11-05 08:01:47
【问题描述】:
我是 AWS EC2 的新手。我创建了一个 RedHat 实例,它运行良好,并且能够在http://ec2-52-41-9-150.us-west-2.compute.amazonaws.com:8080 看到 tomcat 主页,直到我为 GUI 和 RDP 安装了各种软件包。
现在我可以 RDP RedHat 实例,但是从我的本地计算机浏览器 http://ec2-52-41-9-150.us-west-2.compute.amazonaws.com:8080 给我
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
回复。
我怀疑安装各种 GUI 包会阻止对 RedHat 实例上 8080 端口的访问?
我有以下安全组
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
通过 SSH, 我做了
[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...
和
[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
和
[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">
当我进行 curl 时,我的 html 页面正常。可能是什么原因,为什么我收到连接超时错误并且无法在我的 PC 浏览器中看到我的 tomcat 主页?
任何猜测/想法都是有帮助的。谢谢。顺便说一句,在我发布这个问题之前,我已经停止、启动、重新启动了我的实例几次。
【问题讨论】:
-
这个也试过了...
[root@ip-172-31-18-185 ~]# service iptables stopRedirecting to /bin/systemctl stop iptables.service Failed to stop iptables.service: Unit iptables.service not loaded.
标签: tomcat amazon-web-services amazon-ec2