[英]How do I check the web application running on a specific port?
I have a Ruby application running on a server. 我有一个在服务器上运行的Ruby应用程序。
When I run the rails server
command on my server, it shows the following message: 当我在
rails server
上运行rails server
命令时,它显示以下消息:
Rails 3.2.13 application starting in development on http://0.0.0.0:3000
If it was the local machine, I would have typed the following in my browser URL box: 如果是本地计算机,则应在浏览器URL框中键入以下内容:
localhost:3000
or simply: 或者简单地:
http://0.0.0.0:3000
Since this is the server, how do I do this? 由于这是服务器,我该怎么做?
I tried the following, but did not work: 我尝试了以下操作,但没有成功:
http://IP_ADDRESS_OF_SERVER:3000
Any suggestions? 有什么建议么?
Try running netstat -na | grep "LISTEN"
尝试运行
netstat -na | grep "LISTEN"
netstat -na | grep "LISTEN"
and this will show all active listening
ports. netstat -na | grep "LISTEN"
,这将显示所有活动的listening
端口。 The web application must be running on any of these ports. Web应用程序必须在任何这些端口上运行。
You just have to try all of them to find it. 您只需要尝试所有这些都可以找到它。
Maybe the port is closed for outside connections. 也许该端口已关闭以进行外部连接。 Login on your server per ssh and run
通过SSH登录到服务器并运行
$ curl http://localhost:3000
If it returns the rendered index page, the server is running but the port is just disabled by the firewall 如果返回呈现的索引页,则表明服务器正在运行,但是防火墙刚刚禁用了该端口
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.