ubuntu-nginx&Supervisor

1916 단어
nginx
설치: sudo apt - get install nginx 프로필: sudo vim / etc / nginx / sites - available / default
# nginx -c /etc/nginx/nginx.conf 
   nginx
# nginx -s stop
      
# nginx -s reload
# pkill -HUP nginx
        
# nginx -s reopen
# pkill -USR1 nginx
      nginx RPM     /etc/init.d/nginx   ,         :
# service nginx {start|stop|status|restart|reload|configtest|}
server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    
    #      HTTPS,    
    #      https://letsencrypt.org    SSL  
    #listen 443 ssl;
    #ssl_certificate     www.example.com.crt;
    #ssl_certificate_key www.example.com.key;
    #ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    #ssl_ciphers         HIGH:!aNULL:!MD5;
    
    #      HTTP HTTPS
    # rewrite ^(.*)$ https://$host$1 permanent;

    #      ,      
    root /usr/share/nginx/html;
    #   index.php
    index index.php index.html index.htm;

    #       ssl.mcxiaoke.com
    server_name ssl.mcxiaoke.com; #    

    location / {
        try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    #  php-fpm   
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Supervisor
설치: sudo apt - get install supervisor 슈퍼 바 이 저 설정 파일 만 들 기
[program:myapp]
command = gunicorn myapp:app -b localhost:8000
directory = /home/mcxiaoke/myapp
user = mcxiaoke

작업 읽 기 및 실행
sudo pkill gunicorn
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start myapp

좋은 웹페이지 즐겨찾기