1
2
|
[root@VM_0_15_centos ~]# nginx -V
nginx version: nginx/1.10.2
|
检查/换源
1
2
3
4
5
6
7
|
[root@VM_0_15_centos ~]# cd /etc/yum.repos.d/
[root@VM_0_15_centos yum.repos.d]# vim nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
|
升级
1
|
[root@VM_0_15_centos yum.repos.d]# yum update nginx
|
[root@VM_0_15_centos ~]# nginx -V
nginx版本:nginx/1.16.0
检查时报错
1
2
3
|
[root@VM_0_15_centos yum.repos.d]# nginx -t
nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_module.so" version 1010003 instead of 1016000 in /usr/share/nginx/modules/mod-http-geoip.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
|
解决问题
1
2
|
<strong>yum remove nginx-mod* ### 卸载旧模块
</strong>
|
1
|
<strong>yum install nginx-module-* ### 安装新的</strong>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[root@VM_0_15_centos yum.repos.d]# rpm -qa|grep nginx
nginx-mod-http-perl-1.10.3-1.el6.x86_64
nginx-mod-mail-1.10.3-1.el6.x86_64
nginx-1.16.0-1.el6.ngx.x86_64
nginx-filesystem-1.10.3-1.el6.noarch
nginx-mod-stream-1.10.3-1.el6.x86_64
nginx-mod-http-xslt-filter-1.10.3-1.el6.x86_64
nginx-mod-http-geoip-1.10.3-1.el6.x86_64
nginx-mod-http-image-filter-1.10.3-1.el6.x86_64
[root@VM_0_15_centos yum.repos.d]#<strong> yum remove nginx-mod*</strong>
[root@VM_0_15_centos yum.repos.d]#<strong> yum install nginx-module-*</strong>
[root@VM_0_15_centos yum.repos.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@VM_0_15_centos yum.repos.d]# nginx -s reload ###直接平滑重启不可以
|
微信扫描下方的二维码阅读本文