下载nginx离线包

  1. wget http://nginx.org/download/nginx-1.16.1.tar.gz

上传至内网主机

  1. # 提示error:the HTTP * module requires the * library.前往 https://pkgs.org/ 搜索对应rpm包下载安装即可
  2. # 必须要的包 pcre-devel zlib-devel openssl-devel 安装后执行下面操作
  3. tar -xzf nginx-1.16.1.tar.gz
  4. cd nginx-1.16.1
  5. ./configure --with-http_ssl_module
  6. # 启动
  7. /usr/local/nginx/sbin/nginx
  8. # 停止
  9. /usr/local/nginx/sbin/nginx -s stop

可选编译

参考链接

  1. ./configure --prefix=/usr/local/nginx \
  2. --sbin-path=/usr/sbin/nginx \
  3. --modules-path=/usr/lib64/nginx/modules \
  4. --conf-path=/etc/nginx/nginx.conf \
  5. --error-log-path=/var/log/nginx/error.log \
  6. --http-log-path=/var/log/nginx/access.log \
  7. --http-client-body-temp-path=/var/lib/nginx/tmp/client_body \
  8. --http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
  9. --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \
  10. --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
  11. --http-scgi-temp-path=/var/lib/nginx/tmp/scgi \
  12. --pid-path=/run/nginx.pid \
  13. --lock-path=/run/lock/subsys/nginx \
  14. --user=