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..tar.gz
unzip nginx-sticky-module-ng-1.2..zip
mv nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ nginx-sticky-module-ng-1.2.
unzip nginx_upstream_check_module-master
unzip ngx_cache_purge-master.zip
2、编译安装
cd nginx-1.12./
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.
patch -p0 < ../nginx_upstream_check_module-master/nginx-sticky-module.patch
结果
patching file ngx_http_sticky_module.c
Hunk # succeeded at with fuzz (offset lines).
Hunk # succeeded at (offset lines).
Hunk # succeeded at (offset lines).
Hunk # succeeded at (offset lines).
cd ../nginx-1.12.
./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. --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./objs
cp -a nginx /usr/local/nginx/sbin/nginx
5、同时还可以隐藏nginx版本号
在http {—}里加上server_tokens off;

执行curl -I IP

nginx升级方法至1.16.1如下,建议在测试环境或备机执行测试。
1、查看现有nginx版本
/usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.11.
built by gcc 4.4. (Red Hat 4.4.-) (GCC)
built with OpenSSL 1.0.2j Sep
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.0.2j --with-pcre=/usr/local/src/pcre-8.38 --add-module=/usr/local/src/ngx_cache_purge-2.3 --with-http_gzip_static_module
2、备份旧版nginx文件,将新版本的nginx可执行文件复制到nginx的sbin目录
cp -a /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
3、下载,解压并安装新版本nginx-1.16.1,及相关模块
tar -zxvf nginx-1.16..tar.gz
unzip nginx_upstream_check_module-master.zip
编译模块nginx_upstream_check_module
cd nginx-1.16.
patch -p0 < ../nginx_upstream_check_module-master/check_1.14.0+.patch
编译nginx(一定要按照原先编译参数进行编译)
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.0.2j --with-pcre=/usr/local/src/pcre-8.38 --add-module=/usr/local/src/ngx_cache_purge-2.3 --with-http_gzip_static_module --add-module=/root/nginx_upstream_check_module-master make
此时不要执行make install,否则会覆盖nginx文件
4、停止nginx服务,替换nginx执行文件
/usr/local/nginx/sbin/nginx -s stop
cd /root/nginx-1.16./objs
cp -a nginx /usr/local/nginx/sbin/nginx
5、验证nginx版本及业务是否正常
/usr/local/nginx/sbin/nginx -V
欢迎转载,转载请注明出自:
nginx升级至1.12.1版本 - paul_hch - 博客园
http://www.cnblogs.com/paul8339/p/7161316.html
nginx升级至1.12.1版本的更多相关文章
- nginx-1.12.0版本(编译安装)-自定义安装路径
nginx-1.12.0版本(编译安装)-自定义安装路径 安装路径:/application/nginx-1.12.0 1.前期准备 安装编译需要的gcc和gcc-c++ yum install -y ...
- Linux 从4.12内核版本开始移除了 tcp_tw_recycle 配置。 tcp_max_tw_buckets TIME-WAIT 稳定值
被抛弃的tcp_recycle_小米云技术-CSDN博客_sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recy https://blog.csdn.ne ...
- OGG for DB2 z/OS 12.2版本发布
2016-04-15 Oracle发布了GoldenGate for DB2 z/OS 12.2.0.1.2.可以从OTN或eDelivery下载,该版本是ogg for DB2 z/OS的第一个1 ...
- docker 1.12.3版本搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client”
系统环境:centos7 docker版本: 1.12.3(注意版本,可能存在不同版本设置不同的情况) docker registry版本:2.4.1 问题: 成功安装docker registry, ...
- Java_POI之MS-Excel2003(扩展名.xls)升级至MS-Excel2007及以上版本(扩展名.xlsx)技术过程概要
Java_POI之MS-Excel2003(扩展名.xls)升级至MS-Excel2007及以上版本(扩展名.xlsx)技术过程概要 作者:Eric.Zhang(花名:穿越者7号) 日期:2015年1 ...
- 查看nginx | apache | php | tengine | tomcat版本的信息以及如何隐藏版本信息【转】
转自: 查看nginx | apache | php | tengine | tomcat版本的信息以及如何隐藏版本信息 - 追马 - 51CTO技术博客http://lovelace.blog.51 ...
- 【转帖】Gitlab 从 12.1 版本开始将不再支持 MySQL !
Gitlab 从 12.1 版本开始将不再支持 MySQL ! Gitlab 官方宣布,将从 12.1 版本开始不再支持 MySQL 数据库. http://news.51cto.com/art/20 ...
- 查看Linux系统、Apche、Nginx、 MySQL 、 PHP 版本
1. 查看Linux版本: uname -a: more /etc/issue; cat /proc/version; 2. 查看Mysql版本: 在终端下执行 mysql -V #V必须大写 在he ...
- mariadb集群与nginx负载均衡配置--centos7版本
这里配置得是单nginx主机..先准备4台主机,三台mariadb集群,一台nginx. ------------------------------------------------------- ...
随机推荐
- 【Python】内置函数
一.内置函数表格 详细信息 二.内置函数详情 2.1 abs(x) 返回绝对值 1 2 >>> abs(-5) 5 2.2 all(iterable) 如果这个可迭代的元素都为真,就 ...
- HDU2486_A simple stone game
这个题目是这样的,一堆石子有n个,首先第一个人开始可以去1-(n-1)个,接下来两人轮流取石子,每个人可取的石子数必须是一个不超过上一次被取的石子的K倍的整数. 现在求对于一堆数量为n的石子是否为必胜 ...
- poj3041 Asteroids(二分图最小顶点覆盖、二分图匹配)
Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape o ...
- C++解析(31):自定义内存管理(完)
0.目录 1.遗失的关键字mutable 2.new / delete 3.new[] / delete[] 4.小结 5.C++语言学习总结 1.遗失的关键字mutable 笔试题: 统计对象中某个 ...
- 【BZOJ1065】【NOI2008】奥运物流(动态规划)
[BZOJ1065][NOI2008]奥运物流(动态规划) 题面 BZOJ 洛谷 题解 先不考虑环的情况,于是变成了一棵树. 这样子我们答案的贡献是\(\sum_{i=1}^nC_i\times k^ ...
- CF765F Souvenirs 解题报告
CF765F Souvenirs 题意翻译 给出\(n(2 \le n \le 10^5 )\) ,一个长为\(n\)的序列\(a(0 \le a_i \le 10^9 )\). 给出\(m(1\le ...
- move_base的 局部路径规划代码研究
base_local_planner teb_local_planner parameter code g2o base_local_planner ROS wiki Given a plan to ...
- poj1850 Code
Code Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10059 Accepted: 4816 Description ...
- C++模式设计-多线程下的单例模式
1 教科书里的单例模式 我们都很清楚一个简单的单例模式该怎样去实现:构造函数声明为private或protect防止被外部函数实例化,内部保存一个private static的类指针保存唯一的实例,实 ...
- libevent学习文档(二)eventbase相关接口和参数
Setting up a default event_base The event_base_new() function allocates and returns a new event base ...