[root@test_db1 ~]# cd /home/software
[root@test_db1 software]#
[root@test_db1 software]#
[root@test_db1 software]# wget http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.22.0-1.el7.ngx.x86_64.rpm
--2022-08-01 12:58:54-- http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.22.0-1.el7.ngx.x86_64.rpm
正在解析主机 nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...
正在连接 nginx.org (nginx.org)|52.58.199.22|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:815252 (796K) [application/x-redhat-package-manager]
正在保存至: “nginx-1.22.0-1.el7.ngx.x86_64.rpm”
100%[===============================================================================================================================================================>] 815,252 238KB/s 用时 3.3s
2022-08-01 12:58:58 (238 KB/s) - 已保存 “nginx-1.22.0-1.el7.ngx.x86_64.rpm” [815252/815252])
[root@test_db1 software]#
[root@test_db1 software]# wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/pcre2-10.23-2.el7.art.x86_64.rpm
--2022-08-01 12:59:05-- http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/pcre2-10.23-2.el7.art.x86_64.rpm
正在解析主机 www6.atomicorp.com (www6.atomicorp.com)... 51.161.13.101, 51.79.80.20
正在连接 www6.atomicorp.com (www6.atomicorp.com)|51.161.13.101|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:206264 (201K) [application/x-rpm]
正在保存至: “pcre2-10.23-2.el7.art.x86_64.rpm”
8% [============> ] 17,072 47.8KB/s
100%[===============================================================================================================================================================>] 206,264 185KB/s 用时 1.1s
2022-08-01 12:59:09 (185 KB/s) - 已保存 “pcre2-10.23-2.el7.art.x86_64.rpm” [206264/206264])
[root@test_db1 software]#
[root@test_db1 software]#
[root@test_db1 software]# rpm -Uvh pcre2-10.23-2.el7.art.x86_64.rpm
警告:pcre2-10.23-2.el7.art.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 4520afa9: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:pcre2-10.23-2.el7.art ################################# [100%]
[root@test_db1 software]#
[root@test_db1 software]# rpm -Uvh nginx-1.22.0-1.el7.ngx.x86_64.rpm
警告:nginx-1.22.0-1.el7.ngx.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 7bd9bf62: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:nginx-1:1.22.0-1.el7.ngx ################################# [100%]
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* https://nginx.org/en/docs/
Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* https://nginx.org/en/support.html
Commercial subscriptions for nginx are available on:
* https://nginx.com/products/
----------------------------------------------------------------------
[root@test_db1 software]#
[root@test_db1 software]# systemctl restart nginx
[root@test_db1 software]#
[root@test_db1 software]# systemctl status nginx
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since 一 2022-08-01 13:00:09 CST; 10s ago
Docs: http://nginx.org/en/docs/
Process: 27766 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 27767 (nginx)
CGroup: /system.slice/nginx.service
├─27767 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
├─27768 nginx: worker process
├─27769 nginx: worker process
├─27770 nginx: worker process
├─27771 nginx: worker process
├─27772 nginx: worker process
├─27773 nginx: worker process
├─27774 nginx: worker process
├─27775 nginx: worker process
├─27776 nginx: worker process
├─27777 nginx: worker process
├─27778 nginx: worker process
├─27780 nginx: worker process
├─27781 nginx: worker process
├─27783 nginx: worker process
├─27785 nginx: worker process
└─27786 nginx: worker process
8月 01 13:00:09 test_db1 systemd[1]: Starting nginx - high performance web server...
8月 01 13:00:09 test_db1 systemd[1]: Started nginx - high performance web server.
[root@test_db1 software]#
[root@test_db1 software]#
########################################################################################
https://pkgs.org/download/libpcre2-8.so.0()(64bit)
https://centos.pkgs.org/7/centos-aarch64/pcre2-10.23-2.el7.aarch64.rpm.html
https://centos.pkgs.org/7/atomic-x86_64/pcre2-10.23-2.el7.art.x86_64.rpm.html
Install Howto
Download latest atomic-release rpm from
http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/
Install atomic-release rpm:
# rpm -Uvh atomic-release*rpm
Install pcre2 rpm package:
# yum install pcre2
rpm -qa|grep nginx
##########################################################################################
利用 yum 命令和 rpm 命令升级 Nginx 或者安装最新版本 Nginx
方法一:使用 yum 命令升级 Nginx
1、在配置 YUM 仓库的目录(/etc/yum.repos.d/)下新增文件 nginx.repo
vi /etc/yum.repos.d/nginx.repo
nginx.repo 文件的内容如下:
# nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
2、然后执行 yum clean all 和 yum makecache 命令
3、开始升级 nginx
yum update nginx # 升级 Nginx
方法二:在方法一的基础上,先卸载后安装
1、卸载: yum remove nginx
2、安装: yum install nginx -y
方法三:下载Nginx官网的指定rpm包,使用 rpm 命令升级
Nginx官方的 rpm包地址:http://nginx.org/packages/rhel/7/x86_64/RPMS/
1、可以直接升级指定 nginx 版本:
#先下载nginx的rpm包
[root@test soft]# wget http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.22.0-1.el7.ngx.x86_64.rpm
# 再执行 rpm -Uvh nginx-1.12***
[root@test soft]# rpm -Uvh nginx-1.22.0-1.el7.ngx.x86_64.rpm
warning: nginx-1.12.0-1.el7.ngx.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:nginx-1.22.0-1.el7.ngx ################################# [ 50%]
Cleaning up / removing...
2:nginx-1:1.6.3-8.el7 ################################# [100%]
# 升级后
[root@test soft]# rpm -qa|grep nginx
nginx-1.22.0-1.el7.ngx.x86_64