首页 > 系统服务 > 详细

nginx通过Supervisor实现守护进程

时间:2020-01-20 14:30:12      阅读:98      评论:0      收藏:0      [点我收藏+]
  • 部署supervisor服务

    # easy_install的方式
    yum install -y python-setuptools
    easy_install supervisor
    echo_supervisord_conf >/etc/supervisord.conf
  • 配置supervisord.conf

    # 修改supervisord.conf行尾
    
    [include]
    files = /etc/supervisor/*.conf
    
    # web界面显示
    [inet_http_server]
    port=IP:9001
    
    # 启动
    supervisord -c supervisord.conf
    
    # 创建目录
    mkdir -p /etc/supervisor
    
  • 配置nginx.conf文件

    # vim /etc/supervisor/nginx.conf
    [program: nginx]
    command=/data/nginx/sbin/nginx  -g 'daemon off;'  # 修改自己的路径
    autorestart=true ;
    autostart=true ;
    stderr_logfile=/var/log/error.log ;
    stdout_logfile=/var/log/stdout.log ;
    environment=ASPNETCORE_ENVIRONMENT=Production ;
    user=root ;
    stopsignal=INT
    startsecs=10 ;
    startretries=5 ;
    stopasgroup=true
    
    # 重新加载
    supervisorctl -c supervisord.conf reload
    
    # 使用supervisorctl启动nginx服务
    supervisorctl start nginx
    
    #查看状态
    supervisorctl status

nginx通过Supervisor实现守护进程

原文:https://www.cnblogs.com/only-me/p/12217675.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!