Forum: Mongrel Cant access ROR site externally using mongrel on shared host

330edb8dc8bbc5a824984cf46e941b2f?d=identicon&s=25 Tam Kbe (tkbeili)
on 2008-08-15 23:18
Hi,

I have been trying to deploy my Ruby on Rails site using Mongrel on
Shared host. Mongrel seems to start fine using the command below:

cd /home/linkamed/public_html/mysite

mongrel_rails start  -p 12003 -l
/home/linkamed/public_html/mysite/log/mongrel.log -c
/home/linkamed/public_html/mysite/ -e production -d

and If I type something like this on the server:

curl http://localhost:12003/users

I get an HTML code output that resembles what should be displayed which
means that Mongrel is working fine.

I just couldn't figure out how to access it externally!!

I tried www.mysite.com:12003/users - www.mysite.com/12003/users -
www.mysite.com/mysite/users

Is there a rule or configuration I have to do for this to work?

Thanks in Advance,

Tam
1b2f754cb981bc04fc71e37d67f54e79?d=identicon&s=25 Elijah Wright (Guest)
on 2008-08-15 23:31
(Received via mailing list)
odds are that you need to tell mongrel to listen on 0.0.0.0 rather than
127.0.0.1 ..... (the latter being a really common config for mongrels
that
are frontended by something else............)

--elijah
330edb8dc8bbc5a824984cf46e941b2f?d=identicon&s=25 Tam Kbe (tkbeili)
on 2008-08-16 00:17
Thanks Elijah for answer. I thought that might be the problem but
Mongrel will actually start at port 0.0.0.0 unless you expliciatly tell
it to start on 127.0.0.1. Here is output of Mongrel.
** Starting Mongrel listening at 0.0.0.0:12003
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no
restart).
** Rails signals registered.  HUP => reload (without restart).  It might
not work well.
** Mongrel 1.1.4 available at 0.0.0.0:12003
** Use CTRL-C to stop.

Any other ideas?

Thanks
Fdcd0973db4f51080bf8cf839ec61885?d=identicon&s=25 Matte Edens (Guest)
on 2008-08-16 00:45
(Received via mailing list)
since it's a shared host, are you sure they have port 12003 open for
http requests?  usually mongrel is sitting behind apache/nginx which
proxies the requests to the specified port

matte
330edb8dc8bbc5a824984cf46e941b2f?d=identicon&s=25 Tam Kbe (tkbeili)
on 2008-08-18 07:45
Thanks matte that did the trick :) My shared host didn't have that port
open, I assumed they will because CPanel automatically assigned that
port for Mongrel! I talked to them and they opened that port..Thanks
C98e88f3e69340d27466baadb2b80b4c?d=identicon&s=25 Gunnar Wolf (Guest)
on 2008-08-23 04:31
(Received via mailing list)
Tam Kbe dijo [Mon, Aug 18, 2008 at 07:45:20AM +0200]:
> Thanks matte that did the trick :) My shared host didn't have that port
> open, I assumed they will because CPanel automatically assigned that
> port for Mongrel! I talked to them and they opened that port..Thanks

Just FWIW, the usual setup for Mongrel is not having it straight open
to the outside world's requests, but to have it via a HTTP server
handling all the static/easy responses (i.e. images), and leaving
Mongrel just as a backend, application server. That way, you will
decrease the net load on Mongrel.

Greetings,

--
Gunnar Wolf - gwolf@gwolf.org - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF
This topic is locked and can not be replied to.