0
Starting development server at http://0.0.0.0:80/
Quit the server with CONTROL-C.
Error: That port is already in use.

This is on Ubuntu 14

Actually I tried netstat -ap |grep 80 but no process is using 80...

btw, I used 80 for django before. After an unexpected sudden shut down, restart, it show the error above.

The answer of How to 'clear' the port when restarting django runserver does not work for me because I cannot find a process taking 80


P.S. if I change 80 to 81 it will work. So it is definitely 80 taken. But I cannot find who take it.

And I've tried sudo

Community
  • 1
  • 1
DDragon
  • 39
  • 4
  • If you "telnet localhost 80", you should be able to connect to whatever process is on port 80. What happens? – ehaymore Mar 13 '16 at 23:30

2 Answers2

0

Self answer:

Solved!

In fact, it is similar to another answer. But you should do it separately:

This is not working:

sudo lsof -t -i tcp:80 | xargs kill -9

This is working:

sudo lsof -t -i tcp:80
kill -9 xxxxxxx

replace xx with the pids one by one.

DDragon
  • 39
  • 4
0

Or just use this command in linux-ubuntu

fuser -k 80/tcp
Savad KP
  • 1,625
  • 3
  • 28
  • 40