Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start thin on the default port?

Tags:

I'm learning thin server, by now I can use thin start to fire up the server, but the port is 3000, I should type the localhost:3000 in the browser to get the webpage.

I want to take off the 3000 port as we normally do with other site. So I set use the command thin -p 80 start to use the default http port. But I got this error:

root@makserver:~/apps/videosite# thin --port 80 start >> Using rack adapter >> Thin web server (v1.2.7 codename No Hup) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:80, CTRL+C to stop /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError)     from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/backends/tcp_server.rb:16:in `connect'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:49:in `block in start'     from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'     from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'     from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:156:in `start'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'     from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (required)>'     from /usr/local/bin/thin:19:in `load'     from /usr/local/bin/thin:19:in `<main>' 
like image 756
mko Avatar asked Feb 24 '11 03:02

mko


1 Answers

This indicates the port might be already in use.

Also, try running it with administrator privileges

sudo thin start -p 80 

(Thanks to Tom Crinson for his blog article.)

like image 56
Simon Perepelitsa Avatar answered Oct 04 '22 03:10

Simon Perepelitsa