您的位置:首页 > 运维架构 > Nginx

centos 6.7 搭建tornado + nginx + supervisor的方法(已经实践)

2016-12-29 16:13 441 查看
首先,本来不想写这篇博客了,但是我测试了很多网上的例子包括简书的,全不行,我总结原因是自己太笨,搞了俩个晚上,后来决定,自己还是写一篇记录下来,保证自己以后使用

环境:

  centos6.7 64

  python2.7.11

  pip 9.0.1

  nginx1.4.5

[program:python]
command=python /opt/pythonweb/hello.py
directory=/opt/pythonweb
autostart=true                ; start at supervisord start (default: true)
startretries=3                ; max # of serial start failures when starting (default 3)
autorestart=true              ; when to restart if exited after running (def: unexpected)
redirect_stderr=true          ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/nginx.log        ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10     ; # of stdout logfile backups (default 10)
stdout_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
stdout_events_enabled=false   ; emit events on stdout writes (default false)
stderr_logfile=/var/log/nginx_err.log        ; stderr log path, NONE for none; default AUTO
stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)
stderr_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
stderr_events_enabled=false   ; emit events on stderr writes (default false)
user=root


View Code

supervisorctl start nginx  # 启动 nginx
supervisorctl start all    # 启动所有进程
supervisorctl status       # 查看进程状态


5.注意每次更新完supervisor以后一定要重启supervisor,ps -ef | grep supervisor ,,,kill

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: