nginx升级至1.12.1版本

nginx升级至1.12.1

编号

名称

说明

1

nginx-1.12.1.tar.gz

nginx安装程序

2

nginx_upstream_check_module-master.zip

实现后端服务器的健康检查

3

nginx-sticky-module-ng-1.2.5.zip

实现Cookie会话黏贴(session-sticky效果)

4

ngx_cache_purge-master.zip

实现更强大的缓存清除功能

 

注意:必须使用最新的nginx_upstream_check_module才支持nginx 1.12.1版本

下载nginx_upstream_check_module

https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master

 

1、解压软件

tar zxvf nginx-1.12.1.tar.gz
unzip nginx-sticky-module-ng-1.2.5.zip
mv nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ nginx-sticky-module-ng-1.2.5
unzip nginx_upstream_check_module-master
unzip ngx_cache_purge-master.zip

 

2、编译安装

cd nginx-1.12.1/
patch -p0 < ../nginx_upstream_check_module-master/check_1.11.5+.patch
结果
patching file src/http/modules/ngx_http_upstream_hash_module.c
patching file src/http/modules/ngx_http_upstream_ip_hash_module.c
patching file src/http/modules/ngx_http_upstream_least_conn_module.c
patching file src/http/ngx_http_upstream_round_robin.c
patching file src/http/ngx_http_upstream_round_robin.h

 

cd ../nginx-sticky-module-ng-1.2.5
patch -p0 < ../nginx_upstream_check_module-master/nginx-sticky-module.patch
结果
patching file ngx_http_sticky_module.c
Hunk #1 succeeded at 15 with fuzz 2 (offset 5 lines).
Hunk #2 succeeded at 304 (offset 12 lines).
Hunk #3 succeeded at 330 (offset 12 lines).
Hunk #4 succeeded at 352 (offset 12 lines).

 

cd ../nginx-1.12.1
./configure --prefix=/usr/local/nginx --with-pcre --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --add-module=/root/nginx_upstream_check_module-master --add-module=/root/nginx-sticky-module-ng-1.2.5 --add-module=/root/ngx_cache_purge-master
make

 

3、备份旧版nginx文件,将新版本的nginx可执行文件复制到nginx的sbin目录

cp -a /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

 

4、停止nginx服务,替换nginx执行文件

/usr/local/nginx/sbin/nginx -s stop

cd /root/nginx-1.12.1/objs
cp -a nginx /usr/local/nginx/sbin/nginx

 

 欢迎转载,转载请注明出自:

nginx升级至1.12.1版本 - paul_hch - 博客园
http://www.cnblogs.com/paul8339/p/7161316.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值