Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to access a rails server running at 0.0.0.0:3000 on my computer from a tablet on the same wifi.

I can connect to regular webserver :80, but somehow can't get to the :3000.

I tried:

sudo ufw enable 3000

but that didn't help.

share|improve this question
1  
I think that's not the correct command to open a port in UFW. You should try GUFW, it simplifies a lot configuring UFW. –  Salem Feb 19 '13 at 20:49
    
Yup, that worked. Post this as an answer and I'll accept it. –  mreq Feb 19 '13 at 21:23
    
@Salem: would you mind making the answer as to close this question? Thanks! –  mreq May 17 '13 at 9:08
    
Sorry I completely forgot this. –  Salem May 17 '13 at 11:11

2 Answers 2

up vote 2 down vote accepted

The correct command to open that port would be

$ sudo ufw allow 3000                                     # from all hosts
$ sudo ufw allow from 192.168.1.0/24 to any port 3000     # just to some subnet hosts

Also you can resort to gufw, which simplifies a lot the firewall management.

enter image description here

share|improve this answer

If I remember correctly, webrick (I guess you're using script/server) binds only to the local interface. In order for it to be accessible from the outside, start it like this:

script/server -b <your-ip-address>

Obviously you need to enter your ethernet (or wi-fi) IP address for this to work.

share|improve this answer
1  
in rails 3 it's rails s -b ipaddress but the default 0.0.0.0 is open to all, so the -b flag shouldn't be mandatory –  mreq Feb 19 '13 at 21:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.