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!
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.
We have an article on deploying a Sinatra application on Ubuntu 13: <a href=“https://www.digitalocean.com/community/articles/how-to-deploy-sinatra-based-ruby-web-applications-on-ubuntu-13”>https://www.digitalocean.com/community/articles/how-to-deploy-sinatra-based-ruby-web-applications-on-ubuntu-13</a>. <br> <br>I hope that helps.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.