• Django网站直接使用supervisor部署


    python manage.py createsuperuser
    python manage.py migrate

    生成网站的supervisor配置文件:

    echo_supervisord_conf >myWeb.conf

    修改配置文件:
    /etc/supervisor/conf.d/myWeb.conf

    [program:myWeb]
    
    command=/usr/bin/python /data/myWeb/manage.py runserver  0.0.0.0:8000              ; the program (relative uses PATH, can take args)
    
    ;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
    
    ;numprocs=1                    ; number of processes copies to start (def 1)
    
    ;directory=/tmp                ; directory to cwd to before exec (def no cwd)
    
    ;umask=022                     ; umask for process (default None)
    
    ;priority=999                  ; the relative start priority (default 999)
    
    autostart=true                ; start at supervisord start (default: true)
    
    autorestart=true        ; whether/when to restart (default: unexpected)
    
    ;startsecs=1                   ; number of secs prog must stay running (def. 1)
    
    ;startretries=3                ; max # of serial start failures (default 3)
    
    ;exitcodes=0,2                 ; 'expected' exit codes for process (default 0,2)
    
    ;stopsignal=QUIT               ; signal used to kill process (default TERM)
    
    ;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)
    
    ;stopasgroup=false             ; send stop signal to the UNIX process group (default false)
    
    ;killasgroup=false             ; SIGKILL the UNIX process group (def false)
    
    ;user=chrism                   ; setuid to this UNIX account to run the program
    
    ;redirect_stderr=true          ; redirect proc stderr to stdout (default false)
    
    stdout_logfile=/data/myWeb/out.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=/data/myWeb/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)
    
    ;environment=A=1,B=2           ; process environment additions (def no adds)
    
    ;serverurl=AUTO                ; override serverurl computation (childutils)

    启动和停止网站:

    supervisord -c /etc/supervisor/conf.d/myWeb.conf
    
    supervisorctl -c myWeb.conf stop  myWeb
  • 相关阅读:
    【BZOJ1801】【AHOI2009】中国象棋(动态规划)
    【BZOJ3436】小K的农场(差分约束)
    【BZOJ2330】【SDOI2012】糖果(差分约束,SPFA)
    【BZOJ4010】【HNOI2015】菜肴制作(拓扑排序)
    【BZOJ2684】【CEOI2004】锯木厂选址(斜率优化,动态规划)
    【BZOJ1096】【ZJOI2007】仓库建设(斜率优化,动态规划)
    吞吐量(TPS)、QPS、并发数、响应时间(RT)概念
    耐得住寂寞,才能守得住繁华
    想成功,就把这九个公式背下来!
    惊人的社会定律(建议收藏!)
  • 原文地址:https://www.cnblogs.com/ggzone/p/5094489.html
Copyright © 2020-2023  润新知