首页 技术 正文
技术 2022年11月12日
0 收藏 310 点赞 2,606 浏览 896 个字

目录

一.简介

说明

Nginx版本迭代迅速,新版本提供了很多功能,好在Nginx支持不停服务进行升级。

版本之间差距不要太大,不然会导致很多东西不支持

环境

[nginx-server]
主机名:host-1
系统:centos-7.3
地址:1.1.1.1
软件:
nginx-1.8.1 80
nginx-1.10.3 80

二.安装

1.查看当前状态

查看当前版本,有哪些模块,将模块复制粘贴

[root@nginx ~]# nginx -V

2.下载新版本

[root@nginx ~]# yum install gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel

[root@nginx ~]# wget http://nginx.org/download/nginx-1.10.3.tar.gz

[root@nginx ~]# tar -xf nginx-1.10.3.tar.gz

[root@nginx ~]# cd nginx-1.10.3

3.升级

先./configure 再make,不要install,否则覆盖

如果发现1.10不支持老版本的模块,那就删除不要添加那个模块了

[root@nginx ~]# ./configure --xx --xx

[root@nginx ~]# make

4.替换

当前目录objs目录下一个nginx文件,那就是nginx -V时的命令

将旧的备份

[root@nginx ~]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

复制心动的

[root@nginx ~]# cp objs/nginx /usr/local/nginx/sbin/

三.使用验证

1.移动到脚本目录

[root@nginx ~]# cd /usr/local/nginx/sbin/

2.检查配置文件

[root@nginx ~]# nginx -t

3.平滑重启nginx

[root@nginx ~]# nginx -s reload

4.检查版本和模块信息,防止有遗漏

[root@nginx ~]# nginx -V

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295