Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access WEBrick server from outside

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?

like image 341
ESoft Avatar asked Mar 06 '26 17:03

ESoft


2 Answers

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.

like image 62
Maciel Escudero Bombonato Avatar answered Mar 09 '26 13:03

Maciel Escudero Bombonato


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
like image 35
Aggelos Avgerinos Avatar answered Mar 09 '26 11:03

Aggelos Avgerinos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!