ec2中搭建服务后要编辑一下security group才能让外网访问

在aws ec2中搭建apache httpd或tomcat后,发现使用ec2 instance的public ip在浏览器里访问相关服务时失败。

这是因为防火墙未设置。对ec2来说,security group就相当于防火墙。

设置办法: 进入instance列表,在security group列中找到对应的group, 点击它,然后Actions => Edit Inbound Rules, 加入http, 即可允许80端口访问。

如果要打开8080的http端口,新增一个custom tcp rule.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.