1.查看nginx当前版本
[[email protected] nginx]# nginx -v
nginx version: nginx/1.16.1
安装依赖:
[[email protected] nginx]# yum install -y gcc glibc gcc-c++ pcre-devel openssl-devel pcre-devel patch
下载第三方健康监测模块
[[email protected] ~]# wget http://nginx.org/download/nginx-1.14.1.tar.gz
[[email protected] ~]# ll
总用量 1200
-rw-r--r-- 1 root root 173791 10月 26 14:40 master.zip
-rw-r--r-- 1 root root 1032630 8月 14 01:01 nginx-1.16.1.tar.gz
[[email protected] ~]# tar xf nginx-1.16.1.tar.gz
[[email protected] ~]# unzip master.zip
进入nginx目录,打补丁(nginx的版本是1.14补丁就选择1.14的,p1代表在nginx目录,p0是不在nginx目录)
[[email protected] ~]# cd nginx-1.14.1
[[email protected] nginx-1.14.1]# ls
auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src
[[email protected] nginx-1.14.2]# patch -p1 <../nginx_upstream_check_module-master/check_1.14.0+.patch
[[email protected] nginx-1.14.2]# ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --add-module=/root/nginx_upstream_check_module-master --with-cc-opt=‘-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC‘ --with-ld-opt=‘-Wl,-z,relro -Wl,-z,now -pie‘
[[email protected] nginx-1.14.2]# echo $? (查看上一次执行命令的返回结果)
原文地址:https://www.cnblogs.com/syf-com/p/11743495.html