Access WEBrick server from outside

五迷三道 提交于 2019-12-11 02:17:35

问题


I want to be able to access my development server from a machine outside of my home.
I have tried to run rvmsudo rails server -p 80, but when I try to access my computer with my IP, I get to the configuration page of my router...

Any ideas?


回答1:


Have you set up port forwarding on your router? What is the make and model of your router?

See there answers for more help:

  • Setting up the Webrick to serve to internet my rails app

  • cant do port forwarding ro my webrick server to access it from the net!




回答2:


Testing here, to me works like this:

-d = daemon service

-b 0.0.0.0 = make outside access enabled

So, the command is:

$ rails s -d -p 80 -b 0.0.0.0

I hope this can help you.




回答3:


My guess is that you are already having a service (like apache web server) listening on port 80.

All you have to do, is pick a port that's unoccupied and bind the service to it.

rails s -d -p PORT_NUMBER

Then you must set up port-forwarding for that port.

Last but not least, if you have a dynamic (it changes over time) IP address (most common), you must always know your current IP. (http://whatismyip.com)

Then you can connect to your web app like this

http://CURRENT_IP_ADDRESS:PORT_NUMBER


来源:https://stackoverflow.com/questions/13574186/access-webrick-server-from-outside

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!