gpt4 book ai didi

python - 尝试使用 uWSGI 部署 python Pyramid 应用程序

转载 作者:行者123 更新时间:2023-11-28 17:30:20 27 4
gpt4 key购买 nike

我正在尝试使用 uWSGI 部署 Pyramid 应用程序。

应用程序在使用包含的 Pyramid 开发服务器时运行良好。

另外,我之前设置过这个,我发誓它一次就成功了。

但是,现在输入魔法短语会导致“此网页不可用”

我正在努力使所有配置参数尽可能与我目前拥有的相似,这样我就不必担心防火墙问题。

development.ini 中的 uWSGI 部分看起来像这样(来自:Setup uWSGI as webserver with pyramid (no NGINX)):

[uwsgi]
socket = localhost:8080
virtualenv = /var/www/finance/finance-env
die-on-term = 1
master = 1
#logto = /var/log/wsgi/uwsgi.log


enable-threads = true
offload-threads = N
py-autoreload = 1
wsgi-file = /var/www/finance/wsgi.py

wsgy.py 看起来像这样:

from pyramid.paster import get_app, setup_logging
ini_path = '/var/www/finance/corefinance/development.ini'
setup_logging(ini_path)
application = get_app(ini_path, 'main')

这是现在的输出。一切似乎都在端口 8080 上正常收听。

user1@finance1:~$ sudo /var/www/finance/finance-env/bin/uwsgi --ini-paste-logg /var/www/finance/corefinance/development.ini
[uWSGI] getting INI configuration from /var/www/finance/corefinance/development.ini
*** Starting uWSGI 2.0.11.2 (64bit) on [Fri Jan 15 21:13:31 2016] ***
compiled with version: 4.7.2 on 16 November 2015 20:13:35
os: Linux-4.1.5-x86_64-linode61 #7 SMP Mon Aug 24 13:46:31 EDT 2015
nodename: finance1
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/user1
detected binary path: /var/www/finance/finance-env/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your processes number limit is 3934
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)
uwsgi socket 0 bound to TCP address localhost:8080 fd 3
Python version: 3.2.3 (default, Feb 20 2013, 14:49:46) [GCC 4.7.2]
Set PythonHome to /var/www/finance/finance-env
Python main interpreter initialized at 0xfd0a10
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145536 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0xfd0a10 pid: 6275 (default app)
mountpoint already configured. skip.
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 6275)
spawned uWSGI worker 1 (pid: 6282, cores: 1)
Python auto-reloader enabled

最佳答案

除非你是在nginx之类的代理后面,否则你需要使用uwsgi中的内部http路由支持,更改

socket = localhost:8080

http = 0.0.0.0:8080

这是 uwsgi http support docs

关于python - 尝试使用 uWSGI 部署 python Pyramid 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34820404/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com