zoukankan      html  css  js  c++  java
  • nginx、uwsgi

    1.常用命令

      nginx:

        service nginx start   #启动
        service nginx stop    #停止
        service nginx reload  #重启

      uwsgi:

    uwsgi --ini uwsgi.ini # 启动
    uwsgi --stop uwsgi.pid # 停止    
    uwsgi --reload uwsgi.pid # 重启

    2.配置文件

      由三部分组成:

        全局块:主要设置影响nginx服务器整体运行的配置指令

            如:worker_processes  1; worker_processes值越大表示可以支持的并发处理数量越多。

        events块:主要影响nginx服务器与用户网络的连接

            如:worker_connections  1024; 支持的最大连接数

        http块:是nginx服务器配置最频繁的部分,包含http全局块和server块

      nginx:

        server块:

        server {
            listen       80;  # 端口号
            server_name  localhost; # 主机名
            charset utf-8; # 编码
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
            location / {
                uwsgi_pass 127.0.0.1:8000;  # uwsgi的地址和端口号
                include /etc/nginx/uwsgi_params;  # 和uwsgi的协议路径
            }
    
            location /static {
                alias /opt/script/collected_static/; # 静态文件路径
            }
    
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }

      uwsgi:

    [uwsgi]
    socket = 127.0.0.1:8000  # 本机地址和端口号
    chdir = /opt/script/test06  # 项目目录
    module = test06.wsgi  # 项目下面的wsgi.py文件
    master = true
    processes = 1  # 进程
    threads = 2  # 线程
    max-requests = 2000  # 最大链接数
    chmod-socket = 664
    vacuum = true
    # 日志和工具文件等
    stats = %(chdir)/uwsgi/uwsgi.status
    pidfile = %(chdir)/uwsgi/uwsgi.pid
    daemonize = %(chdir)/uwsgi/uwsgi.log
  • 相关阅读:
    队列
    栈的链式存储
    单例和多例设计模式
    顺序栈的基本操作
    串的模式匹配
    线性表的链式存储结构
    倒置顺序表
    回文序列
    go语言系列-从运算符到函数
    go语言系列-从零到数据类型
  • 原文地址:https://www.cnblogs.com/wangdianchao/p/13021753.html
Copyright © 2011-2022 走看看