美文网首页
编译安装Ningx1.10.2

编译安装Ningx1.10.2

作者: i36X | 来源:发表于2017-11-13 19:00 被阅读0次
    1. 下载nginx、pcre、zlib、openssl
    # wget http://nginx.org/download/nginx-1.10.2.tar.gz
    
    # wget https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
    
    # wget https://ncu.dl.sourceforge.net/project/libpng/zlib/1.2.10/zlib-1.2.10.tar.gz
    
    # wget http://distfiles.macports.org/openssl/openssl-1.0.2h.tar.gz
    
    2. 解压*.tar.gz文件
    # tar -zxvf <file_name>.tar.gz
    
    3. 编译、安装、启动
    # ./configure --prefix=/usr/local/nginx --with-pcre=/root/softs/pcre-8.38 --with-zlib=/root/softs/zlib-1.2.10 --with-openssl=/root/softs/openssl-1.0.2h
    
    # make && make install
    
    # nginx
    
    4.配置nginx(已有nginx用户和组的情况下)
    # cd /usr/local/nginx
    # mkdir -p /usr/local/nginx/conf/conf.d
    # vim conf/nginx.conf
    ---------------------------------
    user nginx;
    worker_processes auto;
    error_log /data/log/nginx/error.log;
    pid /var/run/nginx.pid;
    
    # Load dynamic modules. See /usr/share/nginx/README.dynamic.
    include /usr/share/nginx/modules/*.conf;
    
    events {
        worker_connections  1024;
    }
    http {
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /data/log/nginx/access.log  main;
    
        sendfile            on;
        tcp_nopush          on;
        tcp_nodelay         on;
        keepalive_timeout   65;
        types_hash_max_size 2048;
    
        include             /usr/local/nginx/conf/mime.types;
        default_type        application/octet-stream;
        include /usr/local/nginx/conf.d/*.conf;
    }
    

    相关文章

      网友评论

          本文标题:编译安装Ningx1.10.2

          本文链接:https://www.haomeiwen.com/subject/gattvxtx.html