4

I'm setting up my first Django project on a server

When I do python manage.py runserver .0.0.0.0:80, it tells me

You don't have permission to access that port.

When I do python manage.py runserver .0.0.0.0:8000 it tells me that the port is already in use.

I'm trying to run a LAMP stack.

How do I "get permission"? How do I see which processes have ports open?

  • I'm trying to get my account unblocked so that I can add questions again, and this question is weighing my ban down. –  Nov 06 '13 at 17:20

1 Answers1

6

Ports lower than 1024 require privileges. sudo python manage.py runserver .0.0.0.0:80 should do the trick... but if you've got a LAMP stack running on port 80 they won't be able to coexist.

sudo netstat -nlp will tell you what processes have which ports open. It should reveal what's on 8080 already.

ceejayoz
  • 32,910
  • 7
  • 82
  • 106
  • Thanks. Let's say that I want to replace what's previously on my LAMP with this django project. How would I go about doing that? It looks like `mysqld` is on `:::80`, if that's the same as `0.0.0.0:80` –  May 16 '13 at 20:05
  • MySQL's listening on port 80? That's a very odd setup if true. Since you're running on AWS, it might be best to start with a fresh instance and install Python/Django from scratch there, so you don't have LAMP cruft. – ceejayoz May 16 '13 at 20:09
  • Aww man. This was my first server, and I'm so proud of it... I'd rather not abort it in it's third trimester. I'm not used to being a sysadmin, so I guess if this is what happens, I'll get used to it. –  May 16 '13 at 20:14
  • You may want to consider using something like Ansible to build repeatable server setups. It's very handy. – ceejayoz May 16 '13 at 20:19