简体   繁体   English

如何检查在特定端口上运行的Web应用程序?

[英]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.

相关问题 如何在 Rails 应用程序中获取主机和端口 - How do I get the host and port in a Rails application 如何找到我的 rails 服务器正在运行的端口以及如何更改它? - How do I find what port my rails server is running on and how do I change it? 如何检查是否定义了Rails.application.config变量? - How do I check if a Rails.application.config variable is defined? 我如何检查Rails应用程序控制器中是否存在方法? - how do i check for the existence of a method in a rails application controller? 在特定端口上运行 Docker 容器 - Running Docker container on a specific port 如何将特定的gem冻结到Rails 3应用程序中? - How do I freeze a specific gem into a Rails 3 application? 如何在我的 web 应用程序中显示每个 git 提交? - How do I display every git commits in my web application? 如何将特定于应用程序的代码添加到Rails的插件中? - How do I add application specific code to Rails' plugin? 我在3000端口有一个ruby on rails web应用程序工作,我想使其在80端口工作 - I have a ruby on rails web application work at port 3000 I want to make it works at port 80 类似于自助服务终端的网络应用程序-如何“锁定”该应用程序? - Kiosk-like web application - how do I “lock” the app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM