编译安装nginx服务

作者: JONE 分类: 编程 发布时间: 2021-04-29 23:08
  1. 网址详情 https://www.cnblogs.com/xingyunblog/p/9072553.html
  2. 预先安装依赖 yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
  3. nginx 各版本下载地址 http://nginx.org/download/
  4. wget http://nginx.org/download/nginx-1.9.15.tar.gz
  5. tar -zxvf nginx-1.9.15.tar.gz
  6. cd nginx-1.9.15
  7. 选择安装模块预编译
    ./configure \
    --user=nginx \
    --group=nginx \
    --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --with-http_gzip_static_module \
    --with-http_stub_status_module \
    --with-http_ssl_module \
    --with-pcre \
    --with-file-aio \
    --with-http_realip_module \
    --without-http_scgi_module \
    --without-http_uwsgi_module \
    --without-http_fastcgi_module
  8. make && make install
  9. #查看ngixn版本极其编译参数
    
    $ /usr/local/nginx/sbin/nginx -V
    
    nginx version: nginx/1.3.2
    TLS SNI support disabled
    configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module
  10. centos-nginx编译添加模块 https://www.cnblogs.com/hubing/p/3736874.html