相关阅读
制作源与升级
添加中科大镜像,编写repo文件
编辑/etc/yum.repos.d/nginx.repo
文件
name=nginx1
baseurl=http://mirrors.ustc.edu.cn/nginx/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
module_hotfixes=true
更新yum源
yum makecache
更新Nginx
更新nginx版本
yum update nginx -y
确认nginx版本
nginx -v
可以看到显示版本号
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
解决方案
卸载旧模块
yum remove nginx-mod*
安装新的模块
yum install nginx-module-*
启动nginx正常
systemctl start nginx
若原服务已是启动状态,执行如下操作:
nginx -t
如果显示下面的信息代表检测已经成功了
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
重新加载配置文件
nginx -s reload
© 版权声明
THE END
- 最新
- 最热
只看作者