Cant access ROR site externally using mongrel on shared host

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

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

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

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

Tam K. dijo [Mon, Aug 18, 2008 at 07:45:20AM +0200]:

Thanks matte that did the trick :slight_smile: 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 W. - [email protected] - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF

Thanks matte that did the trick :slight_smile: 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