亚马逊aws ec2网络tomcat问题

时间:2013-11-08 12:56:30

标签: amazon-web-services amazon-ec2 redhat

我遇到了与许多其他无法连接到tomcat端口8080

的问题相同的问题

我曾尝试过所有建议,例如安全组。

我接下来做的是创建了amazon linux实例(而不是redhat)

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

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

糟糕的红帽实例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

好的amazon 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工作,我可以再次进行。呼!

由于

2 个答案:

答案 0 :(得分:1)

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

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

答案 1 :(得分: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