ENV:
[root@lnmp ~]# uname -r
3.10.0-514.el7.x86_64
[root@lnmp ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
安装过程:
一:上传或下载nginx的安装包
最好下载Stable version稳定版本,
[root@lnmp Downloads]# ls
mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz nginx-1.16.0.tar.gz
下载地址:http://nginx.org/en/download.html
二:安装nginx的安装依赖包
yum -y install pcre-devel zlib-devel openssl-devel
yum install gcc
这几个是必需安装的,之前因为安装不全,就没有安装成功。
[root@lnmp Downloads]# yum -y install pcre-devel zlib-devel openssl-devel
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
(1/2): extras/7/x86_64/primary_db | 205 kB 00:01
(2/2): updates/7/x86_64/primary_db | 3.0 MB 00:08
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: mirrors.cqu.edu.cn
* updates: ftp.sjtu.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package openssl-devel.x86_64 1:1.0.2k-19.el7 will be installed
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-19.el7 for package: 1:openssl-devel-1.0.2k-19.el7.x86_64
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-19.el7.x86_64
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
--> Processing Dependency: pcre(x86-64) = 8.32-17.el7 for package: pcre-devel-8.32-17.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Processing Dependency: zlib = 1.2.7-18.el7 for package: zlib-devel-1.2.7-18.el7.x86_64
--> Running transaction check
---> Package krb5-devel.x86_64 0:1.15.1-46.el7 will be installed
--> Processing Dependency: libkadm5(x86-64) = 1.15.1-46.el7 for package: krb5-devel-1.15.1-46.el7.x86_64
--> Processing Dependency: krb5-libs(x86-64) = 1.15.1-46.el7 for package: krb5-devel-1.15.1-46.el7.x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-46.el7.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-46.el7.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-46.el7.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-46.el7.x86_64
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-60.el7 for package: 1:openssl-1.0.1e-60.el7.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-19.el7 will be an update
---> Package pcre.x86_64 0:8.32-15.el7_2.1 will be updated
---> Package pcre.x86_64 0:8.32-17.el7 will be an update
---> Package zlib.x86_64 0:1.2.7-17.el7 will be updated
---> Package zlib.x86_64 0:1.2.7-18.el7 will be an update
--> Running transaction check
---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
---> Package krb5-libs.x86_64 0:1.14.1-26.el7 will be updated
---> Package krb5-libs.x86_64 0:1.15.1-46.el7 will be an update
---> Package libcom_err-devel.x86_64 0:1.42.9-17.el7 will be installed
--> Processing Dependency: libcom_err(x86-64) = 1.42.9-17.el7 for package: libcom_err-devel-1.42.9-17.el7.x86_64
---> Package libkadm5.x86_64 0:1.15.1-46.el7 will be installed
---> Package libselinux-devel.x86_64 0:2.5-15.el7 will be installed
--> Processing Dependency: libselinux(x86-64) = 2.5-15.el7 for package: libselinux-devel-2.5-15.el7.x86_64
--> Processing Dependency: libsepol-devel(x86-64) >= 2.5-10 for package: libselinux-devel-2.5-15.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-15.el7.x86_64
---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
---> Package openssl.x86_64 1:1.0.1e-60.el7 will be updated
---> Package openssl.x86_64 1:1.0.2k-19.el7 will be an update
--> Running transaction check
---> Package libcom_err.x86_64 0:1.42.9-9.el7 will be updated
--> Processing Dependency: libcom_err(x86-64) = 1.42.9-9.el7 for package: libss-1.42.9-9.el7.x86_64
--> Processing Dependency: libcom_err(x86-64) = 1.42.9-9.el7 for package: e2fsprogs-libs-1.42.9-9.el7.x86_64
--> Processing Dependency: libcom_err(x86-64) = 1.42.9-9.el7 for package: e2fsprogs-1.42.9-9.el7.x86_64
---> Package libcom_err.x86_64 0:1.42.9-17.el7 will be an update
---> Package libselinux.x86_64 0:2.5-6.el7 will be updated
--> Processing Dependency: libselinux(x86-64) = 2.5-6.el7 for package: libselinux-python-2.5-6.el7.x86_64
--> Processing Dependency: libselinux(x86-64) = 2.5-6.el7 for package: libselinux-utils-2.5-6.el7.x86_64
---> Package libselinux.x86_64 0:2.5-15.el7 will be an update
--> Processing Dependency: libsepol(x86-64) >= 2.5-10 for package: libselinux-2.5-15.el7.x86_64
---> Package libsepol-devel.x86_64 0:2.5-10.el7 will be installed
--> Running transaction check
---> Package e2fsprogs.x86_64 0:1.42.9-9.el7 will be updated
---> Package e2fsprogs.x86_64 0:1.42.9-17.el7 will be an update
---> Package e2fsprogs-libs.x86_64 0:1.42.9-9.el7 will be updated
---> Package e2fsprogs-libs.x86_64 0:1.42.9-17.el7 will be an update
---> Package libselinux-python.x86_64 0:2.5-6.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-15.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.5-6.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-15.el7 will be an update
---> Package libsepol.x86_64 0:2.5-6.el7 will be updated
---> Package libsepol.x86_64 0:2.5-10.el7 will be an update
---> Package libss.x86_64 0:1.42.9-9.el7 will be updated
---> Package libss.x86_64 0:1.42.9-17.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
openssl-devel x86_64 1:1.0.2k-19.el7 base 1.5 M
pcre-devel x86_64 8.32-17.el7 base 480 k
zlib-devel x86_64 1.2.7-18.el7 base 50 k
Installing for dependencies:
keyutils-libs-devel x86_64 1.5.8-3.el7 base 37 k
krb5-devel x86_64 1.15.1-46.el7 base 272 k
libcom_err-devel x86_64 1.42.9-17.el7 base 32 k
libkadm5 x86_64 1.15.1-46.el7 base 179 k
libselinux-devel x86_64 2.5-15.el7 base 187 k
libsepol-devel x86_64 2.5-10.el7 base 77 k
libverto-devel x86_64 0.2.5-4.el7 base 12 k
Updating for dependencies:
e2fsprogs x86_64 1.42.9-17.el7 base 699 k
e2fsprogs-libs x86_64 1.42.9-17.el7 base 168 k
krb5-libs x86_64 1.15.1-46.el7 base 809 k
libcom_err x86_64 1.42.9-17.el7 base 42 k
libselinux x86_64 2.5-15.el7 base 162 k
libselinux-python x86_64 2.5-15.el7 base 236 k
libselinux-utils x86_64 2.5-15.el7 base 151 k
libsepol x86_64 2.5-10.el7 base 297 k
libss x86_64 1.42.9-17.el7 base 46 k
openssl x86_64 1:1.0.2k-19.el7 base 493 k
openssl-libs x86_64 1:1.0.2k-19.el7 base 1.2 M
pcre x86_64 8.32-17.el7 base 422 k
zlib x86_64 1.2.7-18.el7 base 90 k
Transaction Summary
================================================================================
Install 3 Packages (+ 7 Dependent packages)
Upgrade ( 13 Dependent packages)
Total download size: 7.5 M
Downloading packages:
No Presto metadata available for base
warning: /var/cache/yum/x86_64/7/base/packages/krb5-devel-1.15.1-46.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for krb5-devel-1.15.1-46.el7.x86_64.rpm is not installed
(1/23): krb5-devel-1.15.1-46.el7.x86_64.rpm | 272 kB 00:01
(2/23): e2fsprogs-1.42.9-17.el7.x86_64.rpm | 699 kB 00:03
(3/23): libcom_err-devel-1.42.9-17.el7.x86_64.rpm | 32 kB 00:00
(4/23): libkadm5-1.15.1-46.el7.x86_64.rpm | 179 kB 00:01
(5/23): libselinux-2.5-15.el7.x86_64.rpm | 162 kB 00:00
(6/23): libselinux-devel-2.5-15.el7.x86_64.rpm | 187 kB 00:00
(7/23): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm | 37 kB 00:05
(8/23): libselinux-python-2.5-15.el7.x86_64.rpm | 236 kB 00:00
(9/23): krb5-libs-1.15.1-46.el7.x86_64.rpm | 809 kB 00:06
(10/23): libsepol-devel-2.5-10.el7.x86_64.rpm | 77 kB 00:00
(11/23): libss-1.42.9-17.el7.x86_64.rpm | 46 kB 00:00
(12/23): libsepol-2.5-10.el7.x86_64.rpm | 297 kB 00:00
(13/23): libverto-devel-0.2.5-4.el7.x86_64.rpm | 12 kB 00:00
(14/23): openssl-1.0.2k-19.el7.x86_64.rpm | 493 kB 00:01
(15/23): openssl-devel-1.0.2k-19.el7.x86_64.rpm | 1.5 MB 00:05
(16/23): openssl-libs-1.0.2k-19.el7.x86_64.rpm | 1.2 MB 00:05
(17/23): e2fsprogs-libs-1.42.9-17.el7.x86_64.rpm | 168 kB 00:14
(18/23): pcre-8.32-17.el7.x86_64.rpm | 422 kB 00:02
(19/23): pcre-devel-8.32-17.el7.x86_64.rpm | 480 kB 00:01
(20/23): zlib-devel-1.2.7-18.el7.x86_64.rpm | 50 kB 00:00
(21/23): zlib-1.2.7-18.el7.x86_64.rpm | 90 kB 00:02
(22/23): libcom_err-1.42.9-17.el7.x86_64.rpm | 42 kB 00:15
libselinux-utils-2.5-15.el7.x8 FAILED
http://mirrors.aliyun.com/centos/7.8.2003/os/x86_64/Packages/libselinux-utils-2.5-15.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyun.com:80; Operation now in progress"
Trying other mirror.
(23/23): libselinux-utils-2.5-15.el7.x86_64.rpm | 151 kB 00:03
--------------------------------------------------------------------------------
Total 192 kB/s | 7.5 MB 00:40
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libcom_err-1.42.9-17.el7.x86_64 1/36
Updating : libsepol-2.5-10.el7.x86_64 2/36
Updating : zlib-1.2.7-18.el7.x86_64 3/36
Updating : pcre-8.32-17.el7.x86_64 4/36
Updating : libselinux-2.5-15.el7.x86_64 5/36
Updating : 1:openssl-libs-1.0.2k-19.el7.x86_64 6/36
Updating : krb5-libs-1.15.1-46.el7.x86_64 7/36
Installing : libkadm5-1.15.1-46.el7.x86_64 8/36
Installing : pcre-devel-8.32-17.el7.x86_64 9/36
Installing : zlib-devel-1.2.7-18.el7.x86_64 10/36
Installing : libsepol-devel-2.5-10.el7.x86_64 11/36
Installing : libselinux-devel-2.5-15.el7.x86_64 12/36
Updating : e2fsprogs-libs-1.42.9-17.el7.x86_64 13/36
Installing : libcom_err-devel-1.42.9-17.el7.x86_64 14/36
Updating : libss-1.42.9-17.el7.x86_64 15/36
Installing : libverto-devel-0.2.5-4.el7.x86_64 16/36
Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64 17/36
Installing : krb5-devel-1.15.1-46.el7.x86_64 18/36
Installing : 1:openssl-devel-1.0.2k-19.el7.x86_64 19/36
Updating : e2fsprogs-1.42.9-17.el7.x86_64 20/36
Updating : 1:openssl-1.0.2k-19.el7.x86_64 21/36
Updating : libselinux-utils-2.5-15.el7.x86_64 22/36
Updating : libselinux-python-2.5-15.el7.x86_64 23/36
Cleanup : 1:openssl-1.0.1e-60.el7.x86_64 24/36
Cleanup : e2fsprogs-1.42.9-9.el7.x86_64 25/36
Cleanup : 1:openssl-libs-1.0.1e-60.el7.x86_64 26/36
Cleanup : krb5-libs-1.14.1-26.el7.x86_64 27/36
Cleanup : libselinux-utils-2.5-6.el7.x86_64 28/36
Cleanup : e2fsprogs-libs-1.42.9-9.el7.x86_64 29/36
Cleanup : libss-1.42.9-9.el7.x86_64 30/36
Cleanup : libselinux-python-2.5-6.el7.x86_64 31/36
Cleanup : libselinux-2.5-6.el7.x86_64 32/36