vendredi 24 juin 2016

Why do I need a socket for my Python uwsgi app?


I can start my app (Askbot) by

python manage.py runserver `hostname -i`:8000

and would now like to start it with uwsgi instead. So I have created uwsgi.ini containing

[uwsgi]
static-map = /m=/app/static
env = DJANGO_SETTINGS_MODULE=settings
env = NO_DEBUG=T
wsgi-file = /app/django.wsgi
http = 0.0.0.0:80

Below can the output be seen when I start it.

From my understanding I need a socket, if I e.g. would like to use nginx as a reverse proxy on top of uwsgi, but that is not the case here.

Question

Why do I need a socket?

And since it requires a socket, how do I know what it should be?

# /usr/sbin/uwsgi /app/uwsgi.ini 
[uWSGI] getting INI configuration from /app/uwsgi.ini
[uwsgi-static] added mapping for /m => /app/static
*** Starting uWSGI 2.0.12 (64bit) on [Wed Jun 22 14:09:21 2016] ***
compiled with version: 5.3.1 20151207 (Red Hat 5.3.1-2) on 07 January 2016 22:31:51
os: Linux-3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016
nodename: ac5f8aa80b48
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /app
detected binary path: /usr/sbin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 1048576
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
building mime-types dictionary from file /etc/mime.types...1142 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
The -s/--socket option is missing and stdin is not a socket.

Aucun commentaire:

Enregistrer un commentaire