uWSGI, nGinx, and python on Wheezy: how do you configure it?

Veek M vek.m1234 at gmail.com
Tue Dec 16 10:01:57 EST 2014


Has anyone got the thing to work? I want to run some python database scripts 
on nginx. Because that will have a simple web-UI, i decided to go with 
uWSGI. It's proving to be a massive pain.

I found a decent book for nginx and got that bit working. The query gets 
sent to uWSGI but for some reason it can't find my script.

Most of the documentation on the web is utterly horrid and will take a 4 
year PhD to understand. I don't undertsand the architecture of uWsgi - he's 
got a bunch of modules and I don't undertsand what exactly is going on 
inside it!

less /etc/nginx/sites-enabled/default
        location / {
        include uwsgi_params;
        uwsgi_pass unix:/run/uwsgi/app/uwsgi/sockete;
        uwsgi_param UWSGI_PYHOME /usr/share/nginx/cgi;
        uwsgi_param UWSGI_CHDIR /usr/share/nginx;
        uwsgi_param UWSGI_SCRIPT index; #NOT SURE WHAT THIS DOES?


less /etc/uwsgi/apps-enabled/uwsgi.ini
[uwsgi]
plugins=python
socket=/tmp/uwsgi.socket
pythonpath=/usr/share/nginx/cgi/

Tue Dec 16 20:43:21 2014 - Python main interpreter initialized at 0x95cde0
Tue Dec 16 20:43:21 2014 - your server socket listen backlog is limited to 
100 connections
Tue Dec 16 20:43:21 2014 - *** Operational MODE: preforking ***
Tue Dec 16 20:43:21 2014 - added /usr/share/nginx/cgi/ to pythonpath.
Tue Dec 16 20:43:21 2014 - *** no app loaded. going in full dynamic mode ***
Tue Dec 16 20:43:21 2014 - *** uWSGI is running in multiple interpreter mode 
***
Tue Dec 16 20:43:21 2014 - spawned uWSGI master process (pid: 18792)
Tue Dec 16 20:43:21 2014 - spawned uWSGI worker 1 (pid: 18818, cores: 1)
Tue Dec 16 20:43:21 2014 - spawned uWSGI worker 2 (pid: 18819, cores: 1)


::1 - - [16/Dec/2014:21:08:03 +0530] "GET /foo.py HTTP/1.1" 502 172 "-" 
"Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0"



More information about the Python-list mailing list