0

UWSGI 版本 - 2.0.18

Openssl- 1.0.2k-fips

蟒蛇 2.7

得到错误:

uwsgi: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
4

1 回答 1

0

当我们执行 pip install uWSGI 时,它会自动绑定到 openssl 库。

但请确保您已经安装了 openssl 和 openssl-devel 软件包。

我尝试了以下版本:

蟒蛇- 3.6

UWSGI- 2.0.18

命令:

创建 Virtual Env 并安装 flask 和 uWSGI:

virtualenv -p /usr/bin/python3.6 testing
source testing/bin/activate
pip install flask
pip install uWSGI

创建证书:

openssl genrsa -out foobar.key 2048
openssl req -new -key foobar.key -out foobar.csr
openssl x509 -req -days 365 -in foobar.csr -signkey foobar.key -out foobar.crt

创建示例 Python 文件:foobar.py

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"]

运行 uWSGI:

uwsgi --shared-socket 0.0.0.0:443 --uid roberto --gid roberto --https =0,foobar.crt,foobar.key --wsgi-file foobar.py

确保不要与安装在虚拟环境中的 uWSGI 和 root 用户混淆。

遵循文档:

https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html

于 2019-05-28T19:58:29.283 回答