如何使用uwsgi建立单片(插件插件)并通过Fedora上的dnf安装?

时间:2017-01-08 17:48:24

标签: python fedora uwsgi

我一直在努力解决可怕的no site error on uWSGI

发生的事情是,当我将python3指定为插件时,似乎总是希望加载python 2.7。

当我运行uwsgi --plugins-list`时,我回来了:

$ uwsgi --plugins-list

*** uWSGI loaded generic plugins ***
gevent
nagios
rrdtool
carbon
corerouter
fastrouter
http
ugreen
syslog
rsyslog
logsocket
router_uwsgi
router_redirect
router_basicauth
zergpool
redislog
mongodblog
router_rewrite
router_http
logfile
router_cache
rawrouter
router_static
sslrouter
cheaper_busyness
transformation_tofile
transformation_gzip
transformation_chunked
transformation_offload
router_memcached
router_redis
router_hash
router_expires
router_metrics
transformation_template
stats_pusher_socket

*** uWSGI loaded request plugins ***
0: python
17: spooler
18: symcall
100: ping
110: signal
111: cache
173: rpc
--- end of plugins list ---

当我运行uwsgi --plugins-list时,在运行的CentOS服务器上,我回来了:

# uwsgi --plugins-list

*** uWSGI loaded generic plugins ***
corerouter

*** uWSGI loaded request plugins ***
100: ping
101: echo
--- end of plugins list ---

*** Starting uWSGI 2.0.14 (64bit) on [Sun Jan  8 11:42:22 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 05 October 2016 20:03:58
os: Linux-3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016

我使用dnf在Fedora上安装了uwsgi。在CentOS上它来自yum。如果对此的答案是通过pip安装,我会感到非常惊讶,因为这意味着Fedroa库存版本的使用有限,因为它是单片编译的。

1 个答案:

答案 0 :(得分:1)

Fedora和EPEL(用于CentOS)中的uwsgi包的构建方式是必须显式加载大多数插件(python,ruby,psgi,php等)。当您从PyPI安装uwsgi时,它默认构建为python插件。因此,为了在通过RPM安装时可以正常运行,请按以下方式运行:

uwsgi --plugin python <then the rest of your normal arguments>

uwsgi --plugin python3 <then the rest of your normal arguments>