This forum is no longer active. Please post your questions to our new community site

WEBrick only binding to localhost on linux.

Subscribe to WEBrick only binding to localhost on linux. 6 post(s), 2 voice(s)

 
Avatar ams 4 post(s)

I’m trying to run the jrubystack on a red hat linux computer with multiple NICS.

Starting the server with:

> jruby script/server

show below on startup:

=> Booting WEBrick
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

This implies it is binding to all interfaces. HOWEVER, it only responds to requests from “localhost”

For example:
>curl localhost:3000
works, but
>curl dnsname.example.com:3000
DOESN’T.

Despite the line “Rails… starting on 0.0.0.0:3000” it seems to only be binding to 127.0.0.1 !!

since,

> netstat -tulpn | grep :3000

returns

tcp 0 0 ::ffff:127.0.0.1:3000 :::* LISTEN 25942/java

Help!! Where in the configuration can you fix this?

ams

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

That is strange, is there any firewall enabled?

 
Avatar ams 4 post(s)

Yes, the firewall adds this line to open port 3000. (I hope this is right, it works for other ports).

-A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 3000 -j ACCEPT

Could it be related to this bug? See link. The description is almost identical to what I see.

http://jira.codehaus.org/browse/JRUBY-3827

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

yes the rule seems correct but try to disable it and check if that is the problem. In any case we are going to release a new JRuby version today so please check with this new version.

Regards.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

We have just released it.

 
Avatar ams 4 post(s)

Thanks, I just downloaded the new version 1.5.6, and installed it. My problem is now solved!!

While installing the new version however, I found that in the original install of jrubystack 1.2.0, I had answered

127.0.0.1 to the question:

>> Please enter the Tomcat configuration parameters you wish to use.
>> Web Server domain: [127.0.0.1]:

This time I gave the machine’s DNS name.

So, I’m not sure if the “Web Server domian” setting is the fix, or the new JRuby-Stack version.

Would you where I could manually change the “Web Server domain” setting on the old 1.2.0 stack? If it isn’t too hard I wouldn’t mind figuring out the cause.

Regardless, it is now working. Thanks for the help!!