1

我遇到了与其他许多人无法连接到 tomcat 端口 8080 相同的问题

我已经尝试了所有建议,例如安全组。

然后我所做的是我创建了 amazon linux 实例(而不是 redhat)

这有效!我对这两个实例都做了同样的事情:在安全组中添加了 tcp 端口 8080

查看我的 iptables 是否提供了线索?

坏的 redhat 实例 sudo iptables -L

[ec2-user@ip-172-31-37-61 ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

好的亚马逊linux:

[ec2-user@ip-172-31-36-174 ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

几个小时令人沮丧,但现在随着 Amazon-linux 的工作,我可以再次继续。哇!

谢谢

4

2 回答 2

1

我的 EC2 安全组入站配置如下,端口 8080 工作正常。应该是 Type-Custom TCP Rule,Protocol- TCP

下图将显示我的 EC2 安全组入站配置的屏幕截图 截屏

于 2015-12-02T15:39:00.230 回答
0

这是 iptables 的当前内容,包括我最近尝试打开 8080

[ec2-user@ip-172-31-37-61 ~]$ sudo cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
COMMIT
于 2013-11-08T17:31:27.843 回答