nginx平滑升级
平滑升级的步骤
1、获取之前的编译参数
2、下载新模块
3、重新编译软件,加上–add-module=新模块的解压路径
4、停止服务并备份原程序
5、把源程序用新程序覆盖
6、启动新程序
1. 部署nginx
2. 获取之前安装nginx的编译参数
[root@localhost ~]# nginx -V
nginx version: nginx/1.22.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC)
built with OpenSSL 1.1.1k FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log
3.下载新模块
https://github.com/openresty/echo-nginx-module
下载到本地,然后上传到nginx服务器中
4. 重新编译软件
# 解压新的模块包
[root@localhost ~]# ls
anaconda-ks.cfg echo-nginx-module-master.zip nginx-1.22.0.tar.gz
[root@localhost ~]# unzip echo-nginx-module-master.zip
# 再次解压nginx源码包
[root@localhost ~]# tar -zxf nginx-1.22.0.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg echo-nginx-module-master echo-nginx-module-master.zip nginx-1.22.0 nginx-1.22.0.tar.gz
重新编译安装
[root@localhost ~]# cd nginx-1.22.0
[root@localhost nginx-1.22.0]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \