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

相关阅读

NGINX的安装与配置-铭心博客
NGINX的安装与配置-铭心博客
3年前
0705121

制作源与升级

添加中科大镜像,编写repo文件

[root@Mx ~]# 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@Mx ~]# yum makecache  #更新yum源

更新nginx

[root@Mx ~]# yum update nginx -y #更新nginx版本
[root@Mx ~]# nginx -v            #确认nginx版本
nginx version: nginx/1.21.6

错误修复

错误


更新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

解决办法

[root@Mx ~]# yum remove nginx-mod*       # 卸载旧模块
[root@Mx ~]# yum install nginx-module-*  # 安装新的模块
[root@Mx ~]# systemctl start nginx       # 启动nginx正常
 
若原服务已是启动状态,执行如下操作:
[root@Mx ~]# nginx -t                    # 检测配置文件是否正确
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@Mx ~]# nginx -s reload             # 重新加载配置文件

© 版权声明
THE END
喜欢就支持一下吧!
点赞128 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容