如何在 ssh aws ec2 实例之后保留 gunicorn flask app 运行

how to keep gunicorn flask app running after ssh aws ec2 instance

我是服务器和应用程序的新手。

目前,我已经在我的 aws 实例上创建了一个应用程序。

gunicorn --threads 4 -b 0.0.0.0:5000 --access-logfile server.log --timeout 60 server:app

但我想在 ssh 实例后保留它 运行,我该如何实现?

[2018-09-24 17:45:28 +0000] [8318] [INFO] Starting gunicorn 19.9.0
[2018-09-24 17:45:28 +0000] [8318] [INFO] Listening at: 
 http://0.0.0.0:5000 (8318)
[2018-09-24 17:45:28 +0000] [8318] [INFO] Using worker: threads
[2018-09-24 17:45:28 +0000] [8321] [INFO] Booting worker with pid: 8321

我现在也得用control+c退出。

将 --daemon 添加到您的命令行或使用屏幕 (https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-14-04)