[root@kvm1 nginx-1.12.2]# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre --with-file-aio --with-http_secure_link_module
[root@kvm1 ~]# wget http://nginx.org/download/nginx-1.14.0.tar.gz -P /usr/local/src
[root@kvm1 ~]# cd /usr/local/src
[root@kvm1 src]# tar -xf nginx-1.14.0.tar.gz
[root@kvm1 src]# ls
nginx-1.12.2 nginx-1.12.2.tar.gz nginx-1.14.0 nginx-1.14.0.tar.gz php-5.6.38
[root@kvm1 src]# cd nginx-1.14.0/
#用之前编译的参数进行编译,nginx -V 查看到的
[root@kvm1 nginx-1.14.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre --with-file-aio --with-http_secure_link_module
[root@kvm1 nginx-1.14.0]# make
#不要make install
[root@kvm1 nginx-1.14.0]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
[root@kvm1 nginx-1.14.0]# ls
auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src
[root@kvm1 nginx-1.14.0]# cp objs/nginx /usr/local/nginx/sbin/
#测试一下新复制过来的文件是否生效
[root@kvm1 nginx-1.14.0]# /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
#让nginx把nginx.pid文件修改成nginx.pid.oldbin,随即启动nginx,实现不间断服务运行
[root@kvm1 nginx-1.14.0]kill -USR2 `cat /usr/local/nginx/nginx.pid`
#更新配置文件
[root@kvm1 nginx-1.14.0kill -WINCH(平缓停止worker process) `cat /usr/local/nginx/nginx.pid.oldbin
[root@kvm1 nginx-1.14.0]kill -QUIT `cat /usr/local/nginx/nginx.pid.oldbin`
#平缓停止
[root@kvm1 nginx-1.14.0]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.14.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre --with-file-aio --with-http_secure_link_module
nginx平滑升级
最新推荐文章于 2024-09-04 09:15:34 发布