我有一个程序在端口 5005 上运行,并且该端口正在监听并且可以通过本地主机访问:
znc-admin:~/.znc$ netstat -tulpn | grep 5005
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5005 0.0.0.0:* LISTEN 25476/znc
znc-admin:~/.znc$ wget -p http://localhost:5005
--2014-11-26 11:25:21-- http://localhost:5005/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:5005... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1790 (1.7K) [text/html]
Saving to: `localhost:5005/index.html'
100%[===================================================>] 1,790 --.-K/s in 0s
2014-11-26 11:25:21 (155 MB/s) - `localhost:5005/index.html' saved [1790/1790]
Loading robots.txt; please ignore errors.
--2014-11-26 11:25:21-- http://localhost:5005/robots.txt
Connecting to localhost (localhost)|127.0.0.1|:5005... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26 [text/plain]
Saving to: `localhost:5005/robots.txt'
100%[===================================================>] 26 --.-K/s in 0s
2014-11-26 11:25:21 (2.87 MB/s) - `localhost:5005/robots.txt' saved [26/26]
FINISHED --2014-11-26 11:25:21--
Total wall clock time: 0.01s
Downloaded: 2 files, 1.8K in 0s (88.2 MB/s)
不幸的是,从这个端口转发测试网站来看,该端口似乎已关闭:http://www.yougetsignal.com/tools/open-ports/
并且页面http://<my ip>:5005
在我的浏览器中超时。
这让我抓狂了,我错过了什么?
答案1
我觉得这很简单,但也许这会对某些人有所帮助。我只需要通过我的 AWS 控制台向我的安全组(即我的防火墙)添加一个例外。
我之前遇到过几次这种情况,每次都花了一个多小时检查我的服务器的防火墙。所以我希望这能提醒我和其他人检查其他潜在的“防火墙”!