linux - ubuntu 的 UWSGI https 配置

标签 linux django ubuntu uwsgi

我的 django 应用程序在 redhat 7.3 中使用以下 uwsgi 配置运行:

[uwsgi]
project = helloworld
base = %d

chdir=%(base)
module=helloworld.wsgi:application

plugins = router_redirect
route-if = equal:${HTTPS};on addheader:Strict-Transport-Security: max-age=31536000

master = true
processes = 1

enable-threads = true
threads = 1

max-requests = 2000

shared-socket = 0.0.0.0:443
https =  =0,cert/hello.crt,cert/hello.key,HIGH

pidfile = hello_uwsgi.pid

vacuum = true

die-on-term = true

但是,当我在 Ubuntu 16.04.1 LTS 上运行它时,出现以下错误:

your processes number limit is 31283
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
Python version: 3.5.2 (default, Nov 17 2016, 17:05:23)  [GCC 5.4.0 20160609]
Python main interpreter initialized at 0x1dfabe0
python threads support enabled
The -s/--socket option is missing and stdin is not a socket.
VACUUM: pidfile removed.

报错是不是uwsgi绑定(bind)端口失败? 在 ubuntu 中有使用“共享套接字”的特殊方法吗? 我需要在端口 443 和 8443 上运行它。我已尝试对端口 443 和 8443 进行上述配置,但没有成功。

提前致谢。

最佳答案

我通过从源代码重新安装 python 3.5.2 使其在 ubuntu 中工作。

我猜测使用 apt-get 安装 python 3.5.2 存在一些问题/不兼容。

关于linux - ubuntu 的 UWSGI https 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42642956/

相关文章:

android - 如何在shell(终端)中执行monkeyrunner命令

linux - TMUX Pane 中的 vim 发生了什么?

linux - 将应用程序添加到 Ubuntu root 自动运行

linux - 为puppet中的用户设置默认密码管理

iphone - 什么 ios 方法引用 "login through UIWebview and redirects me to another view controller"?

perl - 如何在 Ubuntu 14.04 上安装 Perl 5.10.1?

apache - 如何从 PKCS#7 生成 .key 和 .crt

django - 将 header 从管理员复制到所有模板

python - 向 Django 模型方法添加请求?

docker - docker 登录中的 "Error saving credentials"