xazb
xazb

Reputation: 129

gunicorn not starting on port 80 but starting on port 8000

I am using gunicorn and trying to write the upstart script. I am testing the command in the command line and for port 80 it just gets errors

command

gunicorn --bind 0.0.0.0:80 --workers 3 myapp.wsgi:application

log

[2016-10-19 02:36:51 +0000] [12752] [INFO] Starting gunicorn 19.6.0
[2016-10-19 02:36:51 +0000] [12752] [ERROR] Retrying in 1 second.
[2016-10-19 02:36:52 +0000] [12752] [ERROR] Retrying in 1 second.
[2016-10-19 02:36:53 +0000] [12752] [ERROR] Retrying in 1 second.
[2016-10-19 02:36:54 +0000] [12752] [ERROR] Retrying in 1 second.
[2016-10-19 02:36:55 +0000] [12752] [ERROR] Retrying in 1 second.
[2016-10-19 02:36:56 +0000] [12752] [ERROR] Can't connect to ('0.0.0.0', 80)

any ideas why this is not working? Sometimes it works for port 8000.

Upvotes: 7

Views: 15603

Answers (2)

RoboMex
RoboMex

Reputation: 898

You have to use 'sudo' command for this.

sudo gunicorn --bind 0.0.0.0:80 --workers 3 myapp.wsgi:application

Port 80 requires superuser privilege.

Upvotes: 7

Santiago M. Quintero
Santiago M. Quintero

Reputation: 1273

If you are on a unix-like environment, ports < 1024 (like 80) will require superuser privileges.

From the question: https://stackoverflow.com/a/16225928/6823310

Originally answered by:

https://stackoverflow.com/users/358328/uku-loskit

This is why port 8000 works and 80 do not.

Try running the command with sudo.

Otherwise check if that port is not already being used by another service.

Upvotes: 2

Related Questions