如何在 EC2 实例上打开 Web 服务器端口 [英] How to open a web server port on EC2 instance

查看:36
本文介绍了如何在 EC2 实例上打开 Web 服务器端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 EC2 实例上的 0.0.0.0:8787 上运行 CherryPy Web 服务器.

我可以通过 EC2 机器上的本地 wget 连接到 Web 服务器,但我无法从我自己的远程机器访问该实例(我通过 ssh 连接到 EC2).

我是否需要开放端口 8787 才能远程访问 Web 服务器?如果是这样,如何做到这一点?另外,我可以为此使用 EC2 实例的公共 IP 吗?

解决方案

按照找到您的实例所属的安全组点击入站规则使用下拉菜单并添加 HTTP(端口 80)点击应用并享受

I'm running a CherryPy web server at 0.0.0.0:8787 on an EC2 instance.

I can connect to the web server via local wget on the EC2 machine, but I can't reach the instance from my own remote machine (I connect to EC2 via ssh).

Do I need to open up port 8787 to access the web server remotely? If so, how can this be done? Also, can I use the public IP of the EC2 instance for this?

解决方案

Follow the steps that are described on this answer just instead of using the drop down, type the port (8787) in "port range" an then "Add rule".

Go to the "Network & Security" -> Security Group settings in the left hand navigation

Find the Security Group that your instance is apart of Click on Inbound Rules Use the drop down and add HTTP (port 80) Click Apply and enjoy

这篇关于如何在 EC2 实例上打开 Web 服务器端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆