nginx + uwsgi: -- unavailable modifier requested: 0 --?
10,418
Solution 1
First, make sure that the uwsgi
is installed with python
USE flag enabled:
[I] www-servers/uwsgi
Available versions: ~1.0.2.1 ~1.2.3-r3 ~1.2.3-r4 (~)1.2.4 {apache2 +caps +carbon cgi debug elibc_FreeBSD erlang gevent graylog2 json ldap lua +nagios +pcre perl php php_targets_php5-3 php_targets_php5-4 +python rrdtool rsyslog ruby ruby_targets_ree18 ruby_targets_ruby18 ruby_targets_ruby19 spooler sqlite syslog +xml yaml zeromq}
Installed versions: 1.2.4(10:01:48 PM 09/02/2012)(apache2 caps carbon cgi ldap nagios pcre php_targets_php5-3 python ruby_targets_ruby18 ruby_targets_ruby19 xml -debug -elibc_FreeBSD -erlang -gevent -graylog2 -json -lua -perl -php -php_targets_php5-4 -rrdtool -rsyslog -ruby -ruby_targets_ree18 -spooler -sqlite -syslog -yaml -zeromq)
Homepage: http://projects.unbit.it/uwsgi/
Description: uWSGI server for Python web applications
Second, edit the init script and change the UWSGI_EXEC
variable to /usr/bin/uwsgi_python27
instead of /usr/bin/uwsgi
:
PROGNAME=${SVCNAME#*.}
#UWSGI_EXEC=/usr/bin/uwsgi
UWSGI_EXEC=/usr/bin/uwsgi_python27
PIDPATH=/var/run/uwsgi
PIDFILE="${PIDPATH}/${PROGNAME}.pid"
Then restart the uwsgi
and try again.
Solution 2
For application only. Just set the desired python version in plugins.
Example /etc/uwsgi.d/mysite.ini
:
[uwsgi]
plugins = python27
Related videos on Youtube
Author by
Greg Petersen
Updated on September 18, 2022Comments
-
Greg Petersen over 1 year
I'm following this to install and configure Nginx, uWSGI, and Django on Gentoo. Everything looks good until the last step: Nginx returns the 502 Bad Gateway error and the following appears in the uWSGI log:
*** Starting uWSGI 1.2.4 (32bit) on [Mon Sep 10 23:41:29 2012] *** compiled with version: 4.5.3 on 02 September 2012 22:00:55 detected number of CPU cores: 2 current working directory: /var/www/localhost/htdocs/mysite writing pidfile to /var/run/uwsgi/trac.pid detected binary path: /usr/bin/uwsgi your memory page size is 4096 bytes building mime-types dictionary from file /etc/mime.types...1017 entry found detected max file descriptor number: 1024 lock engine: pthread robust mutexes uwsgi socket 0 bound to TCP address 127.0.0.1:8001 fd 3 your server socket listen backlog is limited to 100 connections *** Operational MODE: single process *** *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 14105) spawned uWSGI worker 1 (pid: 14108, cores: 1) -- unavailable modifier requested: 0 -- -- unavailable modifier requested: 0 --
Google point me to this, but for Ubuntu. What is the equipvalent of the
uwsgi-plugin-python
package on the Gentoo?/etc/nginx/nginx.conf
location /mysite { root /var/www/localhost/htdocs/mysite/polls; uwsgi_pass 127.0.0.1:8001; include uwsgi_params; }
/etc/conf.d/uwsgi.trac
UWSGI_SOCKET="127.0.0.1:8001" UWSGI_THREADS=0 UWSGI_PROGRAM=/var/www/localhost/htdocs/mysite/polls/tests.py UWSGI_XML_CONFIG= UWSGI_PROCESSES=1 UWSGI_LOG_FILE=/var/log/uwsgi/django.log UWSGI_CHROOT= UWSGI_DIR=/var/www/localhost/htdocs/mysite/ UWSGI_USER=uwsgi UWSGI_EMPEROR_PATH= UWSGI_EXTRA_OPTIONS=