zoukankan      html  css  js  c++  java
  • nginx-1.18 编译安装

    环境 centos 7.9

    nginx-1.18

    安装方式 编译安装

    用途:实验项目

    预装:
    yum install -y gcc-c++

    1、安装 pcre -- 正则库
    官网: https://sourceforge.net/projects/pcre/files/pcre/
    wget -cO pcre-8.44.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.gz/download
    tar xf pcre-8.44.tar.gz
    ./configure
    make && make install
    验证 pcre-config --version

    2、安装 zlib-1.2.11 压缩
    地址 http://www.zlib.net/
    tar zxf zlib-1.2.11.tar.gz

    ./configure
    make && make install

    nginx 安装:
    Nginx下载: https://nginx.org/en/download.html

    创建用户: useradd -r -s /sbin/nologin nginx
    解压 tar -xf nginx-1.18.0.tar.gz
    cd nginx-1.18.0/

    ./configure
    --prefix=/usr/local/nginx
    --user=nginx
    --group=nginx
    --with-http_stub_status_module
    --with-http_ssl_module
    --with-http_realip_module
    --with-http_gzip_static_module
    --with-http_v2_module
    --with-pcre
    --with-stream
    --with-stream_ssl_module
    --with-stream_realip_module

    #--with-zlib=/usr/local/src/zlib-1.2.11
    #--with-pcre=/usr/local/src/pcre-8.44

    注解:
    #./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-openssl=/usr/ --with-pcre=/usr/local/src/pcre-8.36
    #注意:--with-pcre=/usr/local/src/pcre-8.44 指向的是源码包解压的路径,而不是组件安装的路径,其他亦然
    make
    make install
    查看是否成功 /usr/local/nginx/sbin/nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

  • 相关阅读:
    Poj 2017 Speed Limit(水题)
    Poj 1316 Self Numbers(水题)
    Poj 1017 Packets(贪心策略)
    Poj 1017 Packets(贪心策略)
    Poj 2662,2909 Goldbach's Conjecture (素数判定)
    Poj 2662,2909 Goldbach's Conjecture (素数判定)
    poj 2388 Who's in the Middle(快速排序求中位数)
    poj 2388 Who's in the Middle(快速排序求中位数)
    poj 2000 Gold Coins(水题)
    poj 2000 Gold Coins(水题)
  • 原文地址:https://www.cnblogs.com/blue-t/p/14494984.html
Copyright © 2011-2022 走看看