Nginx + uwsgi + debian + daemon

Well, first of all, these are just a few tutorials that I used:

projects.unbit.it/uwsgi/wiki/Doc projects.unbit.it/uwsgi/wiki/Install projects.unbit.it/uwsgi/wiki/RunOnNginx projects.unbit.it/uwsgi/wiki/Quickstart 

and realistically, it should only have worked, because these are children's steps. right? http://library.linode.com/web-servers/nginx/python-uwsgi/debian-6-squeeze wrong ... = [Their uwsgi daemon "starter" does not work at all ...

now where i am i can get a simple hello world working if i run uwsgi from the command line, quick example:

 uwsgi -s 127.0.0.1:9001 --wsgi-file /home/www/test/application/wsgi_configuration_module.py 

It seems to be desirable, like not. I like something: it works, but it’s not a daemon, so it works like this: http://i.imgur.com/MUSM4.jpg the problem is that: I can’t do anything, I need to manually start it , it can only run this welcome script world ... where - like when setting up fast nginx + php-fpm I can easily run it on a socket like /tmp/php.sock and I can easily get nginx sending php url to this socket, so php-fpm handles all my php needs ...

What I would like to do:

get uwsgi auto starting from boot

make it work with nginx

get nginx to send python scripts via uwsgi so that it works correctly

get uwsgi with a jar working? (after .. everything else)

Can anyone help me with this? I’m pretty smart, I need several times to understand something, and I have nginx. It works very well for me with php-fpm, but I couldn’t get python to work at all ... and I have several virtual machines to completely install files incorrectly and need to start all over again, so if someone wants to give it away, be my guest .. thanks for any help / links / tips, etc.

+4
source share
1 answer

You can use http://supervisord.org/ to follow the process. As for serving your application, I only know where the WSGI server is called through Python. In Flask docs, you would use gevent, for example:

 from gevent.wsgi import WSGIServer from yourapplication import app http_server = WSGIServer(('', 5000), app) http_server.serve_forever() 

If you have no particular reason to use uWSGI as an application server, I find this setup much easier. nginx just has to act like a proxy. If uWSGI is a requirement, there is a section on nginx configuration in the Flask docs, although I think you already checked it. If not: http://flask.pocoo.org/docs/deploying/uwsgi/#configuring-nginx

+2
source

Source: https://habr.com/ru/post/1432899/


All Articles