Report this

What is the reason for this report?

Cannot run Sinatra application on port 80

Posted on May 24, 2014

I am trying to run some blog software I wrote on port 80 like this: ruby tinyblog.rb -o 80

Only problem is that I get this error: [2014-05-24 01:04:34] INFO WEBrick 1.3.1 [2014-05-24 01:04:34] INFO ruby 2.1.2 (2014-05-08) [x86_64-linux] /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:206:in bind': Permission denied - bind(2) for 127.0.0.1:80 (Errno::EACCES) from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:206:in listen’ from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:461:in block in tcp_server_sockets' from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:232:in each’ from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:232:in foreach' from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/socket.rb:459:in tcp_server_sockets’ from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/utils.rb:75:in create_listeners' from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:132:in listen’ from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:113:in initialize' from /home/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:45:in initialize’ from /home/user/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in new' from /home/user/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in run’ from /home/user/.rvm/gems/ruby-2.1.2/gems/sinatra-1.4.5/lib/sinatra/base.rb:1497:in start_server' from /home/user/.rvm/gems/ruby-2.1.2/gems/sinatra-1.4.5/lib/sinatra/base.rb:1435:in run!’ from /home/user/.rvm/gems/ruby-2.1.2/gems/sinatra-1.4.5/lib/sinatra/main.rb:25:in `block in module:Sinatra

How do I fix this? The application can be found at http://github.com/Quojil/TinyBlog if need be.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ensure that you are not running a web server that is already bound to port 80, and that you are running as a user with root privileges. Root privileges are required for binding to any port below 1024.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.