Amazon AWS EC2端口:连接被拒绝 [英] Amazon AWS EC2 ports: connection refused

查看:925
本文介绍了Amazon AWS EC2端口:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在安全组后面的一个全新AWS账户上创建了一个EC2实例,并在其中加载了一些软件.我正在当前端口4567的计算机上运行Sinatra,并已将我的安全组中的该端口打开了.此外,我能够通过SSH进入EC2实例,但无法在端口4567上进行连接.我正在使用公共IP进行连接:

I have just created an EC2 instance on a brand new AWS account, behind a security group, and loaded some software on it. I am running Sinatra on the machine on port 4567 (currently), and have opened that port in my security group to whole world. Further, I am able to ssh into the EC2 instance, but I cannot connect on port 4567. I am using the public IP to connect:

shakuras:~ tyler$ curl **.***.**.***:22
SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
curl: (56) Recv failure: Connection reset by peer
shakuras:~ tyler$ curl **.***.**.***:4567
curl: (7) Failed connect to **.***.**.***:4567; Connection refused

但是我的网络服务器正在运行,因为当我从localhost卷曲时可以看到该站点:

But my webserver is running, since I can see the site when I curl from localhost:

ubuntu@ip-172-31-8-160:~$ curl localhost:4567
Hello world! Welcome

我以为可能是防火墙,但是我运行了iptables并得到了:

I thought it might be the firewall but I ran iptables and got:

ubuntu@ip-172-31-8-160:~$ 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

我对这里发生的事情非常迷惑.为什么我无法与外界联系?

I'm pretty lost on what is going on here. Why can't I connect from the outside world?

推荐答案

这听起来像是Sinatra绑定的问题.可以检查甚至有关将Sinatra绑定到所有IP地址的链接.

This sounds like issue with the Sinatra binding. Could check this and this and even this link which talks about binding Sinatra to all IP addresses.

这篇关于Amazon AWS EC2端口:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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