python - uWSGI Emperor Mode Not Working Outside of Virtualenv -
i'm trying run django application through uwsgi using emperor mode , vessels, vessel points correctly ini file , ini file defines home
/home/user/.virtualenvs/myvirtualenv, doesn't work (the log says connection prematurely closed). if run same command while in virtualenv, works perfectly, guess uwsgi ignoring home
option. is, however, not useful since need run couple different apps each using own virtualenv (hence why need emperor mode).
this mentioned vessel ini:
# mysite_uwsgi.ini file [uwsgi] #virtualenv = /home/ariel/.virtualenvs/django-ag-panel/ # django-related settings # base directory (full path) chdir = /home/ariel/desarrollo/django/django-ag-panel/ag_panel # django's wsgi file module = ag_panel.wsgi # virtualenv (full path) home = /home/ariel/.virtualenvs/django-ag-panel/
and command use run emperor (i'm using same user 1 hosts app avoid yet more file permission issues):
uwsgi --emperor /etc/uwsgi.d/vassals
and vassal in fact there:
[ariel@e11 ~]$ ls -l /etc/uwsgi.d/vassals/ total 0 lrwxrwxrwx. 1 root root 73 feb 7 21:37 ag_panel_uwsgi.ini -> /home/ariel/desarrollo/django/django-ag-panel/ag_panel/ag_panel_uwsgi.ini
as said, works correctly if run uwsgi command while in virtualenv:
workon django-ag-panel uwsgi --emperor /etc/uwsgi.d/vassals
what doing wrong?
i getting "prematurely closed connection" issue because trying communicate app through nginx , uwsgi. real issue vessel not being loaded correctly, , running manually (outside of virtualenv) found out issue 'site' module not found
error, was, in turn, caused because globally installed (using yum, way), distributor-provided uwsgi package didn't have python support built in , instance couldn't start correctly. takes following…
i think many people has tried configure uwsgi + nginx on linux following these tutorials:
- http://uwsgi-docs.readthedocs.org/en/latest/tutorials/django_and_nginx.html
- https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-applications-using-uwsgi-web-server-with-nginx
- https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04
and other ones; don't point out uwsgi version pip
command , package distributor different, uwsgi quickstart guide points out, distributor may compile uwsgi in "modular" fashion:
one thing may want take account when testing quickstart distro-supplied packages, distribution has built uwsgi in modular way (every feature different plugin must loaded). complete quickstart, have prepend --plugin python,http first series of examples, , --plugin python when http router removed…
whereas package pip comes python support right out of box (at least in case, on fedora linux 23). more, since package manager , pip independent can have both distributor , pip version simultaneously installed, , if problematic, imagine third, local version of package in virtualenv. steps followed follows:
- remove , every version of uwsgi have installed in system (or @ least try clean execution path either pip or distributor-provided package)
- install version of package need (or leave one, in case didn't remove in previous step).
in case choose modular, distributor-provided version:
make sure install
uwsgi-plugin-python.x86_64
,uwsgi-plugin-python3.x86_64
packages, along these ones:uwsgi-router-http.x86_64
,uwsgi-plugin-common.x86_64
, , else might need. then, run uwsgi instance--plugin
option enable either python or python3 support, before of other options.'site' module not found
error should gone now. can use option in ini file (likeplugin = python3
) in case run using config files or vassals.- in case choose pip version: use do.
in cases, make sure version calling , should fine.
Comments
Post a Comment