我正在尝试在ubuntu服务器上运行我的网站。我已经遵循了digitalocean的步骤,因为我有他们的vps服务器。您可以看到教程here。我只需要一台服务器,所以我没有完成第二站点部分。请创建我的mkvirtualenv
命令' Env' root
中的文件夹而不是主页。我不知道它是怎么做的,但是我通过摧毁液滴并再次创建来尝试了两次。两次都这样做了。
我的/etc/uwsgi/sites/app.ini
文件包含以下代码,
[uwsgi]
project = app
uid = root
base = /root
plugins=python3
pyhome=/root/app
chdir = /root/app
home = /root/app
module = app.wsgi:application
master = true
processes = 5
socket = /run/uwsgi/app.sock
chown-socket = root:www-data
chmod-socket = 660
vacuum = true
因此,每次尝试使用sudo uwsgi app.ini --thunder-lock
命令运行usgi服务器时,我都会收到错误消息。
[uWSGI] getting INI configuration from app.ini
open("./python3_plugin.so"): No such file or directory [core/utils.c line 3684]
!!! UNABLE to load uWSGI plugin: ./python3_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.13.1 (64bit) on [Mon Aug 8 04:48:51 2016] ***
compiled with version: 5.4.0 20160609 on 08 August 2016 04:00:28
os: Linux-4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016
nodename: appserver
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /etc/uwsgi/sites
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /root/app
your processes number limit is 1896
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to UNIX address /run/uwsgi/app.sock fd 3
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.5.2 (default, Jul 5 2016, 12:43:10) [GCC 5.4.0 20160609]
Set PythonHome to /root/app
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007f74c576a700 (most recent call first):
Aborted (core dumped)
所以我的根目录有Env
文件夹,而Env
内有另一个文件夹appdata
,其中包含所有virtualenv文件。 root
目录有我的app
文件夹,其中包含Django的应用程序文件。那么有人能告诉我配置中有什么问题吗?
答案 0 :(得分:1)
从源代码构建时(例如,使用pip或make进行安装时),python插件内置于二进制文件中。因此,没有python3_plugin.so
共享库,您在uwsgi设置中不需要plugins=python3
行。
类似的问题是answered here。