栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

nginx升级到最新版本与错误修复

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

nginx升级到最新版本与错误修复

由于之前我的nginx是使用yum默认源,安装的版本是1.14.1,最近漏洞扫描提示需要升级至新版本,索性升级到最新版本

1.制作源与升级 ,1、添加中科大镜像,编写repo文件
[root@QQ ~]# vim /etc/yum.repos.d/nginx.repo
[nginx1]
name=nginx1
baseurl=http://mirrors.ustc.edu.cn/nginx/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
module_hotfixes=true

[root@QQ ~]# yum makecache  #更新yum源
2、更新nginx
[root@QQ ~]# yum update nginx -y #更新nginx版本
[root@QQ ~]# nginx -v            #确认nginx版本
nginx version: nginx/1.21.6
2.错误修复 1.错误

更新nginx到最新版本后,启动nginx报如下错误

[emerg] 1213#1213: module "/usr/lib64/nginx/modules/ngx_http_image_filter_module.so" version 1014001 instead of 1021006 in /usr/share/nginx/modules/mod-http-image-filter.conf:1

2.解决办法
[root@QQ ~]# yum remove nginx-mod*       # 卸载旧模块
[root@QQ ~]# yum install nginx-module-*  # 安装新的模块
[root@QQ ~]# systemctl start nginx       # 启动nginx正常

若原服务已是启动状态,执行如下操作:
[root@QQ ~]# nginx -t                    # 检测配置文件是否正确
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@QQ ~]# nginx -s reload             # 重新加载配置文件

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/730098.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号