3

我试图让 uwsgi 在 Gentoo 系统上与 nginx 一起工作。这是我的配置方式:

nginx:

    server {
        listen 192.168.1.40;
        server_name localhost;

        access_log /var/log/nginx/localhost.access_log main;
        error_log /var/log/nginx/localhost.error_log info;

    location ~* (web|download|authenticate|db_login|delete|dir_list|upload)\.py$ {
                uwsgi_pass 127.0.0.1:3031;
                include uwsgi_params;
        }


        root /var/www/dude;
    }

development uwsgi.d # cat web.ini 
[uwsgi]
socket = 127.0.0.1:3031
chdir = /home/one/development/copy_files/modules/
module = web
processes = 4
threads = 2
development uwsgi.d # 

我有一个简单的 python 脚本来测试: development uwsgi.d # cat /home/one/development/copy_files/modules/web.py

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return "Hello World"
development uwsgi.d # 

我调用脚本的方式是在 javascript 中:

xml.open("GET", "python/web.py", true);

但是,当我单击运行的网页的按钮时,xml.open("GET", "python/web.py", true);我得到一个“--不可用的修饰符请求:0--”uwsgi 错误:

development uwsgi.d # uwsgi web.ini
[uWSGI] getting INI configuration from web.ini
*** Starting uWSGI 1.4.10 (64bit) on [Tue Sep 17 19:59:07 2013] ***
compiled with version: 4.6.3 on 17 September 2013 19:12:48
os: Linux-3.10.7-gentoo #1 SMP Wed Sep 11 20:17:44 CDT 2013
nodename: development
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /etc/uwsgi.d
detected binary path: /usr/bin/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 16003
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address 127.0.0.1:3031 fd 3
your server socket listen backlog is limited to 100 connections
mapped 329536 bytes (321 KB) for 8 cores
*** Operational MODE: preforking+threaded ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (pid: 27975, cores: 2)
spawned uWSGI worker 2 (pid: 27976, cores: 2)
spawned uWSGI worker 3 (pid: 27977, cores: 2)
spawned uWSGI worker 4 (pid: 27978, cores: 2)
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
4

1 回答 1

1

gentoo 包是模块化的,你需要加载 uWSGI python 插件

于 2013-09-18T10:29:29.380 回答