1

I'm on a Windows machine, and I'm trying to start a rails app on port 80. I'm running the command prompt as an administrator, but when I try rails server --port=80, I get

TCPServer Error: Permission denied - bind(2)

Running on port 81 works fine, though, and I'm not running anything else on port 80. What do I need to do?

grautur
  • 29,955
  • 34
  • 93
  • 128
  • Do you have any other web servers running? What happens when you go to `http://localhost/`? – Garrett Mar 28 '11 at 19:45
  • @Garrett, nope, no other web servers running. I just get a standard "Oops! This link appears to be broken" error (in Chrome). – grautur Mar 28 '11 at 20:05
  • Oops, I lied. I ran `netstat -a` and apparently there was something running by default. Question solved! – grautur Mar 28 '11 at 20:12

2 Answers2

1

I ran netstat -a and apparently there was something already running on port 80 by default. (I'd delete the question if I could.)

grautur
  • 29,955
  • 34
  • 93
  • 128
1

On some Linux systems you need to be root to bind to ports less than 1024.

Flexo
  • 87,323
  • 22
  • 191
  • 272
SooDesuNe
  • 9,880
  • 10
  • 57
  • 91
  • If you are running Linux Kernel 2.6.24 or above and have libcap installed, you can allow program to bind to ports under 1014 as non-root user. See more at: http://stackoverflow.com/a/414258 – Devy Jun 11 '14 at 20:55