2
回答
uWSGI + Nginx 部署多个 Flask 失败
百度AI开发者大赛带你边学边开发,赢100万奖金,加群:418589053   

使用两个网址部属Flask

  1. a. domain.com
  2. b. domain.com

资料位置

  1. /home/a
  2. /home/b

在执行a程序的指令时,正常可运作,但同时需要再一起执行b时就会出错(下方代碼)

root@ubuntu:/home/b# /home/b/venv/bin/uwsgi /home/b/b_socket.ini
[uWSGI] getting INI configuration from /home/b/b_socket.ini
*** WARNING: Can't find section "uwsgi" in INI configuration file /home/b/b_socket.ini ***
*** Starting uWSGI 2.0.15 (64bit) on [Mon Aug 21 13:33:55 2017] ***
compiled with version: 4.8.4 on 21 August 2017 00:29:16
os: Linux-4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016
nodename: ubuntu
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /home/a
detected binary path: /home/b/venv/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 3887
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)
The -s/--socket option is missing and stdin is not a socket.

 

配置

a_socket.ini

[uwsgi]
vhost = true
socket = 127.0.0.1:8099
venv = /home/a/lineenv                                          
#plugins = python
chidir = /home/a
wsgi-file = app.py
callable = app
logto = /home/a/logs/list.log
pidfile = /tmp/a.pid 

b_socket.ini

[uwsgi]
vhost = true
socket = 127.0.0.1:9099
venv = /home/b/venv                                         
#plugins = python
chidir = /home/b
wsgi-file = app.py
callable = app
logto = /home/b/logs/list.log
vacuum=False
pidfile = /tmp/b.pid 

 

举报
FAT_HuiHui
发帖于12个月前 2回/148阅
顶部