nginx1.18.0*滑升级步骤

发布于:2021-11-29 03:40:47

文件上传到/urs/local目录下。


执行tar zxvf? ? nginx-1.18.0.tar.gz 解压。


cd /usr/local/nginx-1.18.0
1、查看当前Nginx版本
?? ?[root@test-25 nginx-1.18.0]# /usr/local/nginx/sbin/nginx? -V
?? ?nginx version: nginx/0.7.9
?? ?built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
?? ?configure arguments: --prefix=/usr/local/nginx


2、配置nginx并编译,切记不要make install
?? ??[root@test-25 nginx-1.18.0]#./configure --prefix=/usr/local/nginx
?? ??[root@test-25 nginx-1.18.0]#make



3、备份原来的nginx文件,使用最新的文件


??? 先看一下文件日期:
?? ?[root@test-25 nginx-1.18.0]# ll /usr/local/nginx/sbin/nginx
?? ?-rwxr-xr-x 1 root root 2337456 Aug 12? 2015 /usr/local/nginx/sbin/nginx


?? ??[root@test-25 nginx-1.18.0]#mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old


4、使用最新的文件
?? ?[root@test-25 nginx-1.18.0]#cp? /usr/local/nginx-1.18.0/objs/nginx /usr/local/nginx/sbin/nginx
??? 再看一下文件日期:
??? [root@test-25 nginx-1.18.0]#? ll /usr/local/nginx/sbin/nginx
??? -rwxr-xr-x 1 root root 3784415 Sep? 2 16:31 /usr/local/nginx/sbin/nginx


5、升级nginx(提示正常)
?? ?[root@test-25 nginx-1.18.0]# make upgrade
?? ?/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
?? ?kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
?? ?sleep 1
?? ?test -f /usr/local/nginx/logs/nginx.pid.oldbin
?? ?kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`



6、查看升级后版本信息(升级成功,且服务不中断)


?? [root@test-25 local]#? /usr/local/nginx/sbin/nginx? -V
?? nginx version: nginx/1.18.0
?? built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
?? configure arguments: --prefix=/usr/local/nginx

相关推荐

最新更新

猜你喜欢