nginx 升级为最新版 nginx -1.12.0

公司目前使用的nginx版本比较低(nginx-1.0.12),请网络安全公司做了一下“远程安全评估”,发现有下列漏洞: 
nginx URI处理安全限制绕过漏洞(CVE-2013-4547) 
Nginx ‘access.log‘不安全文件权限漏洞(CVE-2013-0337) 
nginx SSL会话固定漏洞(CVE-2014-3616) 
nginx resolver 拒绝服务漏洞(CVE-2016-0747) 
nginx resolver 拒绝服务漏洞(CVE-2016-0742) 
nginx ‘ngx_http_mp4_module.c‘缓冲区溢出漏洞 
nginx标头解析内存泄露漏洞 
nginx ‘ngx_http_close_connection()‘远程整数溢出漏洞 
nginx 空指针间接引用漏洞(CVE-2016-4450) 
nginx resolver 释放后重利用漏洞(CVE-2016-0746)

为了修复上面的漏洞,决定将nginx 更新为nginx-1.12.0

1.首先下载 nginx-1.12.0.tar.gz,nginx-upstream-jvm-route-master.zip 
ngx_cache_purge-2.3.tar.gz 
附件中有依赖包

2.解压  tar -zxvf ngx_cache_purge-2.3.tar.gz 
tar -zxvf  nginx-upstream-jvm-route-master.zip 
tar -zxvf  nginx-1.12.0.tar.gz

3.通过./nginx -V 查看原来安装时的参数

[[email protected] sbin]# ./nginx -V 
nginx version: nginx/1.0.12 
configure arguments: --prefix=/opt/nginx --with-http_stub_status_module --with-pcre=/opt/soft/pcre-8.21 --add-module=../nginx_upstream_jvm_route/ --add-module=../ngx_cache_purge-1.5 --add-module=../nginx_upstream_check_module-master

4.进入  nginx-1.12.0 执行: 
patch -p0 < nginx-upstream-jvm-route-master所在路径下的jvm_route.patch 
patch -p0 < /opt/soft/nginx-upstream-jvm-route-master/jvm_route.patch 
注意一定要执行,否则make 时会报错误

5.执行 
[[email protected] nginx-1.12.0]# ./configure --prefix=/opt/nginx --with-http_stub_status_module --with-pcre=/opt/soft/pcre-8.21 --add-module=/opt/soft/nginx-upstream-jvm-route-master/ --add-module=/opt/soft/ngx_cache_purge-1.5 --add-module=/opt/soft/nginx_upstream_check_module-master

6. [[email protected] nginx-1.12.0]#make

7.[[email protected] nginx-1.12.0] mv /opt/nginx/sbin/nginx /opt/nginx/sbin/nginx.old 
8.[[email protected] nginx-1.12.0] cp objs/nginx /opt/nginx/sbin/ 
9.[[email protected] nginx-1.12.0]# make upgrade 
/opt/nginx/sbin/nginx -t 
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok 
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful 
kill -USR2 `cat /opt/nginx/logs/nginx.pid` 
sleep 1 
test -f /opt/nginx/logs/nginx.pid.oldbin 
kill -QUIT `cat /opt/nginx/logs/nginx.pid.oldbin`

注意:升级是不需要关闭nginx

10.[[email protected] nginx-1.12.0]# /opt/nginx/sbin/nginx -V 
nginx version: nginx/1.12.0 
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) 
configure arguments: --prefix=/opt/nginx --with-http_stub_status_module --with-pcre=/opt/soft/pcre-8.21 --add-module=/opt/soft/nginx-upstream-jvm-route-master/ --add-module=/opt/soft/ngx_cache_purge-2.3 --add-module=/opt/soft/nginx_upstream_check_module-master

升级成!

模块说明: 
nginx_upstream_check_module 来检测后方realserver的健康状态,如果后端服务器不可用,则所以的请求不转发到这台服务器。 
nginx_upstream_jvm_route: 通过session cookie的方式来获取session粘性。如果在cookie和url中并没有session,则这只是个简单的round-robin 负载均衡。

ngx_cache_purge:缓存模块

模块下载:http://gjp014.iteye.com/blog/2384146

时间: 2025-01-11 04:22:05

nginx 升级为最新版 nginx -1.12.0的相关文章

nginx升级

Nginx最近有漏洞爆出,于是把原来的nginx-1.6.2平滑升级至nginx-1.12.1稳定版.并记录这一过程,参照这一过程也适用其他版本的升级. 1. 开始之前先查看一下当前使用的版本. # /usr/local/webserver/nginx/sbin/nginx -V nginx: nginx version: nginx/1.0.5 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI suppor

nginx升级不改变配置文件

查看当前版本是:1.10.3 [[email protected] nginx-1.10.3]# /usr/local/nginx/sbin/nginx -Vnginx version: nginx/1.10.3built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) built with OpenSSL 1.0.2k-fips  26 Jan 2017TLS SNI support enabledconfigure arguments: --us

【Nginx】源码安装Nginx 平滑升级Nginx

Web服务对比 Linux平台 Php.Python:nginx.tengine(淘宝).apache Jave:tomcat.Jboss.IBM WebSphere Windows平台:IIS(.net) Nginx的优点:性能高.并发高.静态网站.动态网站(php.python) 在对比其他web软件的情况下nginx的性能更加好!在国内广泛使用 Nginx 十分轻量级的HTTP服务器 是一个高性能的HTTP和反向代理服务器 官方网站: http://nginx.org/ Nginx以及现代

最新版勤哲Excel服务器V2016.12.0.292无限用户支持手机APP,微信,网页等功能不绑定电脑,任意安装,支持后续升级

最新版勤哲Excel服务器V2016.12.0.292无限用户支持手机APP,微信,网页等功能不绑定电脑,任意安装,支持后续升级. 这个版本发布过之后,再发布新的版本需要到下个月的中下旬,老朋友可以使用本版本后面延续升级 目前有大约127家用户在用,没有修改过注册授权文件,系统非常成熟,推荐指数为五星,QQ:619920289 麦枫论坛http://www.mfsun.com 简介 EXCEL服务器作为一款客户化.综合性管理软件,它通过Excel就能构造出您自主的管理系统:同时,她也可将您公司现

nginx 升级指南,最详细的nginx升级步骤

查看nginx当前版本 通过nginx -V 命令就可以查看当前的版本,已经当前版本安装时候的一些nginx命令 [[email protected] sbin]# ./nginx -V nginx version: nginx/1.2.9 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) configure arguments: --prefix=/nginx_instal     1.下载新版本的nginx 1.44,解压后,进入该目录

nginx 升级openssl

有一段时间,发现openssl 版本的漏洞,所以必须升级 1.升级openssl 1.1查看当前openssl 版本: # openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 当前版本显然过久,必须下载最新版本到1.0.1g及以上. 1.2.软件包下载: 下载路径: # wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz 1.3.安装openssl # tar -zxvf openssl-1

Nginx 升级版本或者重新编译增加参数

Nginx 升级版本或者重新编译增加参数 这里我们重新编译下,增加nginx用户和组 先创建用户 #useradd nginx 开始编译 #cd /usr/local/nginx-1.6.1 #./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --h

nginx升级步骤

今天应开发的需求,需要在Nginx增加一个模块,并不能影响现有的业务,所以就必须要平滑升级Nginx,好了,不多说了 1:查看现有的nginx编译参数 /usr/local/nginx/sbin/nginx -V 2:按照安装nginx的方法进行安装,只需要到make,千万不要make install 3: 备份旧版本的nginx可执行文件(期间nginx不会停止服务) mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old

【前端】CentOS 7 系列教程之五: 安装最新版 nginx 并设置 nginx 代理转发 node 服务

转载请注明出处:http://www.cnblogs.com/shamoyuu/p/linux_5.html 进入/usr/local目录 cd /usr/local 下载最新版的ngxin压缩包 wget http://nginx.org/download/nginx-1.13.9.tar.gz 解压 tar -zxvf nginx-1.13.9.tar.gz 删除压缩包 rm -f nginx-1.13.9.tar.gz 进入nginx目录准备安装 cd nginx-1.13.9 使用默认配