无法使用AMI设置和访问EC2上的tomcat

我试图在运行AMI的EC2实例上启动tomcat7,但无法使用公共IP从浏览器访问Web服务。

  1. 使用默认的AMI创build一个EC2实例作为图像
  2. 创build一个弹性IP并将其与实例关联
  3. 安装tomcat7并确保它在inet.d中启动
  4. 在安全组中创build了一个快速入门1的条目,并添加了端口8080。
  5. 已validation安全组已正确添加到实例中。
  6. validation了tomcat是在端口8080上

无法使用公共DNS名称或IP地址从浏览器访问http服务器。

一些实例的输出如下所示:

ec2-user@ip-10-202-49-142 ~$ sudo fuser -n tcp 8080 8080/tcp: 1162 

 ec2-user@ip-10-202-49-142 ~$ sudo netstat -apn Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1019/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1088/sendmail tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1052/sshd tcp 0 300 10.202.49.142:22 198.6.50.15:28002 ESTABLISHED 1253/sshd tcp 0 0 ::1:631 :::* LISTEN 1019/cupsd tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 1162/java tcp 0 0 :::8009 :::* LISTEN 1162/java tcp 0 0 :::8080 :::* LISTEN 1162/java tcp 0 0 :::22 :::* LISTEN 1052/sshd udp 0 0 0.0.0.0:68 0.0.0.0:* 928/dhclient udp 0 0 0.0.0.0:631 0.0.0.0:* 1019/cupsd udp 0 0 10.202.49.142:123 0.0.0.0:* 1073/ntpd udp 0 0 127.0.0.1:123 0.0.0.0:* 1073/ntpd udp 0 0 0.0.0.0:123 0.0.0.0:* 1073/ntpd udp 0 0 fe80::1031:3bff:fe12:326:123 :::* 1073/ntpd udp 0 0 ::1:123 :::* 1073/ntpd udp 0 0 :::123 :::* 1073/ntpd Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 ACC STREAM LISTENING 3054 1237/gam_server @/tmp/fam-root- unix 2 ACC STREAM LISTENING 1072 1/init @/com/ubuntu/upstart unix 7 [ ] DGRAM 1882 978/rsyslogd /dev/log unix 2 ACC STREAM LISTENING 2408 1019/cupsd /var/run/cups/cups.sock unix 2 ACC SEQPACKET LISTENING 1139 584/udevd @/org/kernel/udev/udevd unix 2 ACC STREAM LISTENING 1936 999/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ] DGRAM 3935 1318/sudo unix 3 [ ] STREAM CONNECTED 3124 1253/sshd unix 3 [ ] STREAM CONNECTED 3123 1256/sshd unix 2 [ ] DGRAM 3120 1253/sshd unix 3 [ ] STREAM CONNECTED 3057 1237/gam_server @/tmp/fam-root- unix 3 [ ] STREAM CONNECTED 3056 1235/python unix 3 [ ] STREAM CONNECTED 3041 999/dbus-daemon /var/run/dbus/system_bus_socket unix 3 [ ] STREAM CONNECTED 3040 1235/python unix 2 [ ] DGRAM 2780 1171/crond unix 2 [ ] DGRAM 2663 1096/sendmail: Queu unix 2 [ ] DGRAM 2645 1088/sendmail unix 2 [ ] DGRAM 2566 1073/ntpd unix 3 [ ] STREAM CONNECTED 1945 999/dbus-daemon /var/run/dbus/system_bus_socket unix 3 [ ] STREAM CONNECTED 1944 1/init unix 3 [ ] STREAM CONNECTED 1940 999/dbus-daemon unix 3 [ ] STREAM CONNECTED 1939 999/dbus-daemon unix 3 [ ] DGRAM 1155 584/udevd unix 3 [ ] DGRAM 1154 584/udevd 

 ec2-user@ip-10-202-49-142 ~$ sudo iptables --list 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 ec2-user@ip-10-202-49-142 ~$ 

看起来像只有一个ipv6的tomcat套接字,而不是一个ipv4

 :::8080 :::* LISTEN 1162/java