How to connect rails application(locally run on zeus) in another machine using IP?

221 views Asked by At

I am using two rails applications, running both with rails s and zeus s -p3001 locally. When I am trying to run my application in another machine, the server started with webbrick is running fine on another system but couldnot run zeus. PLease help me out.

I just gave the url in browser 192.168.1.111:3000 (running). And

`192.168.1.111:3001` (server not found).

I tried zeus s -b 192.168.1.111:3001 but didn't help me.

1

There are 1 answers

2
Boris Brodski On

The problem is, that the zeus bind to the local address (127.0.0.1) prohibiting connections from remove hosts. The proper solution would be to setup the reverse proxy using apache2 or nginx.

Alternatively you may also want to use firewall to redirect requests.

But a quick and dirty solution is to use SSH port forwarding like this:

  • Start zeus on remote machine on port 3000
  • On local machine

    local-machine$ ssh -L 3001:localhost:3000 remote-machine
    
  • On local machine: Connect to localhost:3001 instead of to remote-machine:3000

http://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html