升级nginx 版本到1.26.2
原始版本:1.23.4
升级后版本:1.26.2
- 停应用
查看nginx的启动路径,停止nginx
ps -ef | frep nginx 获取pid
cd /proc/pid
ll
进入nginx启动路径,停止Ngnix, 验证是否停止
- 备份
查看nginx/conf 中nginx.conf配置文件是否有依赖,有依赖文件同样需要备份
cp -r conf/ /opt/post/conf_20240902/
- 升级
解压nginx 1.26.2 tar包
tar -zxf nginx-1.26.2.tar.gz
- 查看原始版本编译脚本
cd nginx/sbin/
Nginx -V
- 执行编译脚本
cd nginx-1.26.2
./configure --prefix=/opt/post/nginx --with-http_stub_status_module --with-http_sub_module --with-pcre --with-http_ssl_module —add-module=/opt/post/nginx-sticky-module-ng
执行无误后,make
Make 成功后,执行 make install