最新nginx 1.25.0 平滑升级、修复安全漏洞【测试成功】

艺帆风顺 发布于 2025-04-03 25 次阅读


一、问题背景

    

漏洞:F5 Nginx 缓冲区错误漏洞(CVE-2022-41741)

若您不需要使用该应用或服务,请关闭该应用或服务即可。
目前厂商已经发布了升级补丁以修复这个安全问题。截止2023年6月30日,建议升级到当前最新版本nginx 1.25,或后续更高版本。
下载地址:
http://nginx.org/en/download.html

二、升级步骤

    上传nginx-1.25.0 到服务器上。[root@host- local]# tar -zxvf nginx-1.25.0.tar.gz进入到原nginx文件目录下,复制nginx文件。[root@host- sbin]# cp nginx nginx20230605.old进入到新上传后解压的nginx-1.25.0目录下[root@host- local]# cd nginx-1.25.0/[root@host- nginx-1.25.0]# lsauto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src安装nginx[root@host- nginx-1.25.0]# ./configure --prefix=/usr/local/nginx[root@host- nginx-1.25.0]# make中间系统操作过程省略[root@host- nginx-1.25.0]# lsauto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src[root@host- nginx-1.25.0]# cd objs[root@host- objs]# lsautoconf.err nginx ngx_auto_config.h ngx_modules.c srcMakefile nginx.8 ngx_auto_headers.h ngx_modules.o[root@host- nginx-1.25.0]# cp -f objs/nginx /usr/local/nginx/sbin/nginxcp:是否覆盖"/usr/local/nginx/sbin/nginx"?y[root@host- nginx-1.25.0]# /usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful[root@host- nginx-1.25.0]# /usr/local/nginx/sbin/nginx -s reload[root@host- nginx-1.25.0]# /usr/local/nginx/sbin/nginx -Vnginx version: nginx/1.25.0built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)configure arguments: --prefix=/usr/local/nginx[root@host- nginx-1.25.0]# ps -ef | grep nginxroot 8740 19970 0 15:38 ? 00:00:00 nginx: worker processroot 8759 8664 0 15:40 pts/0 00:00:00 grep --color=auto nginxroot 19970 1 0 3月27 ? 00:00:00 nginx: master process ./nginx

    如果需要加载SSL模块,则执行:

    ./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/conf/nginx.pid --lock-path=/usr/local/nginx/lock/nginx.lock --with-http_ssl_module
      版权声明:本文内容始发于CSDN>作者:weixin_49737591,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。始发链接:https://blog.csdn.net/weixin_49737591/article/details/131050522在此特别鸣谢原作者的创作。此篇文章的所有版权归原作者所有,商业转载建议请联系原作者,非商业转载请注明出处.