gunicorn flask nginx环境配置

防火墙端口设置****修改后要重启生效(有时在控制面板中设置80端口无法生效)

/etc/init.d/iptables status
service iptables stop
firewall-cmd --state
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=79-85/tcp --permanent
firewall-cmd --list-ports
firewall-cmd --reload
firewall-cmd --list-ports

 

 启动gunicorn服务:nohup gunicorn -w 2 -b 0.0.0.0:8080 hello:app &

1.nohup

用途:不挂断地运行命令。

语法:nohup Command [ Arg … ] [ & ]

  无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。

  如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。

  如果没有文件能创建或打开以用于追加,那么 Command 参数指定的命令不可调用。

退出状态:该命令返回下列出口值:   
  126 可以查找但不能调用 Command 参数指定的命令。   
  127 nohup 命令发生错误或不能查找由 Command 参数指定的命令。   
  否则,nohup 命令的退出状态是 Command 参数指定命令的退出状态。

2.&

用途:在后台运行

一般两个一起用

nohup command &

 

posted @ 2018-06-28 11:15  小小财经  阅读(608)  评论(0编辑  收藏  举报