Why can't I access Webrick web server from other computers?

Hi everyone,

I have a rails project running on Ubuntu. When I ran it on localhost http://localhost:3000, it worked perfectly. But when I tried to access from other computers in the same network by either http://hostname:3000 or http://[ipaddress]:3000, I got a "Internet Explorer cannot display the webpage" error.

I double checked my ubuntu with iptables, no rules are defined:

iptables -L

Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination

Did I miss some configurations? Any ideas?

Thanks in advance.

xianese

What does it say when ruby script/server boots up? It should be binding to either your IP address or to 0.0.0.0 (all IP addresses).

Hey, You should start webrick or mongrel with ./script/server -b <IP_ADDRESS> -p <PORT> [-e production]

Then you will be able to access it from other machines on the network.

Cheers, Pavan

Pavankumar Kulkarni wrote:

Hey, You should start webrick or mongrel with ./script/server -b <IP_ADDRESS> -p <PORT> [-e production]

Then you will be able to access it from other machines on the network.

Cheers, Pavan

Pavan and Julian,

it works!!!

Thanks a lot.

Mian

To get this working in internet explorer in development, you have to prepend the address with HTTP:// when using a port (:3000), without http:// IE will fail to load the page