LNMP 环境搭建记录

Nginx是一款小巧而高效的Web服务器软件,可帮您在Linux系统下快速方便地搭建出LNMP Web服务环境。本教程介绍如何手动在ECS实例上搭建LNMP环境,其中LNMP分别代表LinuxNginxMySQLPHP

系统:CentOS
Nginx版本:Nginx 1.16.1
MySQL版本:MySQL 5.7.28
PHP版本:PHP 7.2.34
详细安装步骤请看https://www.jianshu.com/p/40ee08163469

搭建环境具体步骤如下:

[root@localhost ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg
[root@localhost ~]# cd /
[root@localhost /]# ls
\bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[root@localhost /]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-11-23 16:18:20 CST; 2min 38s ago
     Docs: man:firewalld(1)
 Main PID: 811 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─811 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Nov 23 16:18:17 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 23 16:18:20 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost /]# systemctl stop firewall
Failed to stop firewall.service: Unit firewall.service not loaded.
[root@localhost /]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-11-23 16:18:20 CST; 3min 31s ago
     Docs: man:firewalld(1)
 Main PID: 811 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─811 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Nov 23 16:18:17 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 23 16:18:20 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost /]# systemctl stop firewalld
[root@localhost /]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2020-11-23 16:22:17 CST; 2s ago
     Docs: man:firewalld(1)
  Process: 811 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 811 (code=exited, status=0/SUCCESS)

Nov 23 16:18:17 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 23 16:18:20 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Nov 23 16:22:16 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
Nov 23 16:22:17 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost /]# getenforce
Enforcing
[root@localhost /]# getenforce 0
Enforcing
[root@localhost /]# setenforce 0
[root@localhost /]# getenforce
Permissive
[root@localhost /]# getenforce

[root@localhost /]# setenforce 0
[root@localhost /]# getenforce
Permissive
[root@localhost /]# setenforce 0
[root@localhost /]# getenforce
Permissive
[root@localhost /]# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[root@localhost /]# yum -y install nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
No package nginx available.
Error: Nothing to do
[root@localhost /]# yum -y install nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
No package nginx available.
Error: Nothing to do
[root@localhost /]# yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                    Arch                                                 Version                                             Repository                                            Size
================================================================================================================================================================================================================================
Installing:
 epel-release                                               noarch                                               7-11                                                extras                                                15 k

Transaction Summary
================================================================================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: Y
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for epel-release-7-11.noarch.rpm is not installed
epel-release-7-11.noarch.rpm                                                                                                                                                                             |  15 kB  00:00:00     
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-8.2003.0.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: Y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                                                                                     1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                                                     1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                                                                                    

Complete!
[root@localhost /]# yum -y install nginx
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 3881.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  30 M RSS (450 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:02 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  30 M RSS (450 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:04 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  31 M RSS (739 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:06 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  31 M RSS (739 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:08 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  62 M RSS (762 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:10 ago
    State  : Running, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 254 M RSS (960 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:12 ago
    State  : Running, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 253 M RSS (960 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:14 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 253 M RSS (960 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:16 ago
    State  : Sleeping, pid: 3881
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 253 M RSS (960 MB VSZ)
    Started: Mon Nov 23 16:33:30 2020 - 00:18 ago
    State  : Sleeping, pid: 3881
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.16.1-3.el7 will be installed
--> Processing Dependency: nginx-all-modules = 1:1.16.1-3.el7 for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: nginx-filesystem = 1:1.16.1-3.el7 for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_1)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1()(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1()(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Running transaction check
---> Package nginx-all-modules.noarch 1:1.16.1-3.el7 will be installed
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-stream = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
---> Package nginx-filesystem.noarch 1:1.16.1-3.el7 will be installed
---> Package openssl11-libs.x86_64 1:1.1.1c-2.el7 will be installed
--> Running transaction check
---> Package nginx-mod-http-image-filter.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-http-perl.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-mail.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.16.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                             Arch                                           Version                                                  Repository                                    Size
================================================================================================================================================================================================================================
Installing:
 nginx                                                               x86_64                                         1:1.16.1-3.el7                                           epel                                         563 k
Installing for dependencies:
 nginx-all-modules                                                   noarch                                         1:1.16.1-3.el7                                           epel                                          20 k
 nginx-filesystem                                                    noarch                                         1:1.16.1-3.el7                                           epel                                          21 k
 nginx-mod-http-image-filter                                         x86_64                                         1:1.16.1-3.el7                                           epel                                          30 k
 nginx-mod-http-perl                                                 x86_64                                         1:1.16.1-3.el7                                           epel                                          39 k
 nginx-mod-http-xslt-filter                                          x86_64                                         1:1.16.1-3.el7                                           epel                                          29 k
 nginx-mod-mail                                                      x86_64                                         1:1.16.1-3.el7                                           epel                                          57 k
 nginx-mod-stream                                                    x86_64                                         1:1.16.1-3.el7                                           epel                                          85 k
 openssl11-libs                                                      x86_64                                         1:1.1.1c-2.el7                                           epel                                         1.4 M

Transaction Summary
================================================================================================================================================================================================================================
Install  1 Package (+8 Dependent packages)

Total download size: 2.3 M
Installed size: 5.5 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/nginx-1.16.1-3.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 352c64e5: NOKEY                                                          ]  0.0 B/s |    0 B  --:--:-- ETA 
Public key for nginx-1.16.1-3.el7.x86_64.rpm is not installed
(1/9): nginx-1.16.1-3.el7.x86_64.rpm                                                                                                                                                                     | 563 kB  00:00:01     
(2/9): nginx-all-modules-1.16.1-3.el7.noarch.rpm                                                                                                                                                         |  20 kB  00:00:00     
(3/9): nginx-filesystem-1.16.1-3.el7.noarch.rpm                                                                                                                                                          |  21 kB  00:00:00     
(4/9): nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm                                                                                                                                               |  30 kB  00:00:00     
(5/9): nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm                                                                                                                                                       |  39 kB  00:00:00     
(6/9): nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm                                                                                                                                                |  29 kB  00:00:00     
(7/9): nginx-mod-mail-1.16.1-3.el7.x86_64.rpm                                                                                                                                                            |  57 kB  00:00:00     
(8/9): nginx-mod-stream-1.16.1-3.el7.x86_64.rpm                                                                                                                                                          |  85 kB  00:00:00     
(9/9): openssl11-libs-1.1.1c-2.el7.x86_64.rpm                                                                                                                                                            | 1.4 MB  00:00:01     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                           816 kB/s | 2.3 MB  00:00:02     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:openssl11-libs-1.1.1c-2.el7.x86_64                                                                                                                                                                         1/9 
  Installing : 1:nginx-filesystem-1.16.1-3.el7.noarch                                                                                                                                                                       2/9 
  Installing : 1:nginx-mod-http-perl-1.16.1-3.el7.x86_64                                                                                                                                                                    3/9 
  Installing : 1:nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64                                                                                                                                                             4/9 
  Installing : 1:nginx-mod-http-image-filter-1.16.1-3.el7.x86_64                                                                                                                                                            5/9 
  Installing : 1:nginx-mod-stream-1.16.1-3.el7.x86_64                                                                                                                                                                       6/9 
  Installing : 1:nginx-1.16.1-3.el7.x86_64                                                                                                                                                                                  7/9 
  Installing : 1:nginx-mod-mail-1.16.1-3.el7.x86_64                                                                                                                                                                         8/9 
  Installing : 1:nginx-all-modules-1.16.1-3.el7.noarch                                                                                                                                                                      9/9 
  Verifying  : 1:nginx-mod-mail-1.16.1-3.el7.x86_64                                                                                                                                                                         1/9 
  Verifying  : 1:nginx-mod-http-perl-1.16.1-3.el7.x86_64                                                                                                                                                                    2/9 
  Verifying  : 1:nginx-1.16.1-3.el7.x86_64                                                                                                                                                                                  3/9 
  Verifying  : 1:nginx-filesystem-1.16.1-3.el7.noarch                                                                                                                                                                       4/9 
  Verifying  : 1:nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64                                                                                                                                                             5/9 
  Verifying  : 1:nginx-all-modules-1.16.1-3.el7.noarch                                                                                                                                                                      6/9 
  Verifying  : 1:openssl11-libs-1.1.1c-2.el7.x86_64                                                                                                                                                                         7/9 
  Verifying  : 1:nginx-mod-http-image-filter-1.16.1-3.el7.x86_64                                                                                                                                                            8/9 
  Verifying  : 1:nginx-mod-stream-1.16.1-3.el7.x86_64                                                                                                                                                                       9/9 

Installed:
  nginx.x86_64 1:1.16.1-3.el7                                                                                                                                                                                                   

Dependency Installed:
  nginx-all-modules.noarch 1:1.16.1-3.el7 nginx-filesystem.noarch 1:1.16.1-3.el7 nginx-mod-http-image-filter.x86_64 1:1.16.1-3.el7 nginx-mod-http-perl.x86_64 1:1.16.1-3.el7 nginx-mod-http-xslt-filter.x86_64 1:1.16.1-3.el7
  nginx-mod-mail.x86_64 1:1.16.1-3.el7    nginx-mod-stream.x86_64 1:1.16.1-3.el7 openssl11-libs.x86_64 1:1.1.1c-2.el7             

Complete!
[root@localhost /]# nginx -v
nginx version: nginx/1.16.1
[root@localhost /]# rpm -Uvh  http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
warning: /var/tmp/rpm-tmp.50Hn2P: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql57-community-release-el7-9  ################################# [100%]
[root@localhost /]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 3961.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 265 M RSS (968 MB VSZ)
    Started: Mon Nov 23 16:34:42 2020 - 00:13 ago
    State  : Sleeping, pid: 3961
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 265 M RSS (968 MB VSZ)
    Started: Mon Nov 23 16:34:42 2020 - 00:15 ago
    State  : Sleeping, pid: 3961
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.32-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.32-1.el7 for package: mysql-community-server-5.7.32-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.32-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.32-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.32-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.32-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.65-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.32-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.32-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                          Arch                                        Version                                              Repository                                              Size
================================================================================================================================================================================================================================
Installing:
 mysql-community-libs                                             x86_64                                      5.7.32-1.el7                                         mysql57-community                                      2.3 M
     replacing  mariadb-libs.x86_64 1:5.5.65-1.el7
 mysql-community-libs-compat                                      x86_64                                      5.7.32-1.el7                                         mysql57-community                                      1.2 M
     replacing  mariadb-libs.x86_64 1:5.5.65-1.el7
 mysql-community-server                                           x86_64                                      5.7.32-1.el7                                         mysql57-community                                      173 M
Installing for dependencies:
 mysql-community-client                                           x86_64                                      5.7.32-1.el7                                         mysql57-community                                       25 M
 mysql-community-common                                           x86_64                                      5.7.32-1.el7                                         mysql57-community                                      308 k

Transaction Summary
================================================================================================================================================================================================================================
Install  3 Packages (+2 Dependent packages)

Total download size: 202 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.32-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY                              ] 256 kB/s | 223 kB  00:13:27 ETA 
Public key for mysql-community-common-5.7.32-1.el7.x86_64.rpm is not installed
(1/5): mysql-community-common-5.7.32-1.el7.x86_64.rpm                                                                                                                                                    | 308 kB  00:00:01     
(2/5): mysql-community-libs-5.7.32-1.el7.x86_64.rpm                                                                                                                                                      | 2.3 MB  00:00:01     
(3/5): mysql-community-libs-compat-5.7.32-1.el7.x86_64.rpm                                                                                                                                               | 1.2 MB  00:00:01     
(4/5): mysql-community-client-5.7.32-1.el7.x86_64.rpm                                                                                                                                                    |  25 MB  00:00:14     
(5/5): mysql-community-server-5.7.32-1.el7.x86_64.rpm                                                                                                                                                    | 173 MB  00:01:20     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                           2.4 MB/s | 202 MB  00:01:24     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql57-community-release-el7-9.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : mysql-community-common-5.7.32-1.el7.x86_64                                                                                                                                                                   1/6 
  Installing : mysql-community-libs-5.7.32-1.el7.x86_64                                                                                                                                                                     2/6 
  Installing : mysql-community-client-5.7.32-1.el7.x86_64                                                                                                                                                                   3/6 
  Installing : mysql-community-server-5.7.32-1.el7.x86_64                                                                                                                                                                   4/6 
  Installing : mysql-community-libs-compat-5.7.32-1.el7.x86_64                                                                                                                                                              5/6 
  Erasing    : 1:mariadb-libs-5.5.65-1.el7.x86_64                                                                                                                                                                           6/6 
  Verifying  : mysql-community-client-5.7.32-1.el7.x86_64                                                                                                                                                                   1/6 
  Verifying  : mysql-community-libs-compat-5.7.32-1.el7.x86_64                                                                                                                                                              2/6 
  Verifying  : mysql-community-libs-5.7.32-1.el7.x86_64                                                                                                                                                                     3/6 
  Verifying  : mysql-community-server-5.7.32-1.el7.x86_64                                                                                                                                                                   4/6 
  Verifying  : mysql-community-common-5.7.32-1.el7.x86_64                                                                                                                                                                   5/6 
  Verifying  : 1:mariadb-libs-5.5.65-1.el7.x86_64                                                                                                                                                                           6/6 

Installed:
  mysql-community-libs.x86_64 0:5.7.32-1.el7                             mysql-community-libs-compat.x86_64 0:5.7.32-1.el7                             mysql-community-server.x86_64 0:5.7.32-1.el7                            

Dependency Installed:
  mysql-community-client.x86_64 0:5.7.32-1.el7                                                                   mysql-community-common.x86_64 0:5.7.32-1.el7                                                                  

Replaced:
  mariadb-libs.x86_64 1:5.5.65-1.el7                                                                                                                                                                                            

Complete!
[root@localhost /]# 
[root@localhost /]# mysql -V
mysql  Ver 14.14 Distrib 5.7.32, for Linux (x86_64) using  EditLine wrapper
[root@localhost /]# systemctl start mysqld
[root@localhost /]# systemctl enable mysqld
[root@localhost /]# systemctl daemon-reload
[root@localhost /]# yum install \
> https://repo.ius.io/ius-release-el7.rpm \
> https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Loaded plugins: fastestmirror, langpacks
ius-release-el7.rpm                                                                                                                                                                                      | 8.2 kB  00:00:00     
Examining /var/tmp/yum-root-iZmc8X/ius-release-el7.rpm: ius-release-2-1.el7.ius.noarch
Marking /var/tmp/yum-root-iZmc8X/ius-release-el7.rpm to be installed
epel-release-latest-7.noarch.rpm                                                                                                                                                                         |  15 kB  00:00:00     
Examining /var/tmp/yum-root-iZmc8X/epel-release-latest-7.noarch.rpm: epel-release-7-13.noarch
Marking /var/tmp/yum-root-iZmc8X/epel-release-latest-7.noarch.rpm as an update to epel-release-7-11.noarch
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be updated
---> Package epel-release.noarch 0:7-13 will be an update
---> Package ius-release.noarch 0:2-1.el7.ius will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                            Arch                                         Version                                              Repository                                                           Size
================================================================================================================================================================================================================================
Installing:
 ius-release                                        noarch                                       2-1.el7.ius                                          /ius-release-el7                                                    4.5 k
Updating:
 epel-release                                       noarch                                       7-13                                                 /epel-release-latest-7.noarch                                        25 k

Transaction Summary
================================================================================================================================================================================================================================
Install  1 Package
Upgrade  1 Package

Total size: 29 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : epel-release-7-13.noarch                                                                                                                                                                                     1/3 
  Installing : ius-release-2-1.el7.ius.noarch                                                                                                                                                                               2/3 
  Cleanup    : epel-release-7-11.noarch                                                                                                                                                                                     3/3 
  Verifying  : ius-release-2-1.el7.ius.noarch                                                                                                                                                                               1/3 
  Verifying  : epel-release-7-13.noarch                                                                                                                                                                                     2/3 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                                                     3/3 

Installed:
  ius-release.noarch 0:2-1.el7.ius                                                                                                                                                                                              

Updated:
  epel-release.noarch 0:7-13                                                                                                                                                                                                    

Complete!
[root@localhost /]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Retrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
warning: /var/tmp/rpm-tmp.rcY9Tb: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:webtatic-release-7-3             ################################# [100%]
[root@localhost /]# yum -y install php70w-devel php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64  php70w-pdo.x86_64   php70w-mysqlnd  php70w-fpm php70w-opcache php70w-pecl-redis php70w-pecl-mongodb
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
 * webtatic: uk.repo.webtatic.com
webtatic                                                                                                                                                                                                 | 3.6 kB  00:00:00     
(1/2): webtatic/x86_64/group_gz                                                                                                                                                                          |  448 B  00:00:01     
(2/2): webtatic/x86_64/primary_db                                                                                                                                                                        | 271 kB  00:00:20     
Resolving Dependencies
--> Running transaction check
---> Package php70w.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: httpd-mmn = 20120211x8664 for package: php70w-7.0.33-1.w7.x86_64
--> Processing Dependency: httpd for package: php70w-7.0.33-1.w7.x86_64
---> Package php70w-cli.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-common.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-devel.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: pcre-devel(x86-64) for package: php70w-devel-7.0.33-1.w7.x86_64
---> Package php70w-fpm.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-gd.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-ldap.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-mbstring.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-mcrypt.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php70w-mcrypt-7.0.33-1.w7.x86_64
---> Package php70w-mysqlnd.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-opcache.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-pdo.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-pecl-mongodb.x86_64 0:1.5.3-1.w7 will be installed
--> Processing Dependency: /usr/bin/pecl for package: php70w-pecl-mongodb-1.5.3-1.w7.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php70w-pecl-mongodb-1.5.3-1.w7.x86_64
---> Package php70w-pecl-redis.x86_64 0:3.1.6-1.w7 will be installed
--> Processing Dependency: php-pecl-igbinary(x86-64) for package: php70w-pecl-redis-3.1.6-1.w7.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-97.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-97.el7.centos for package: httpd-2.4.6-97.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-97.el7.centos.x86_64
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
---> Package php70w-pear.noarch 1:1.10.4-1.w7 will be installed
--> Processing Dependency: php70w-xml for package: 1:php70w-pear-1.10.4-1.w7.noarch
--> Processing Dependency: php70w-posix for package: 1:php70w-pear-1.10.4-1.w7.noarch
---> Package php70w-pecl-igbinary.x86_64 0:2.0.5-1.w7 will be installed
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-97.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
---> Package php70w-process.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-xml.x86_64 0:7.0.33-1.w7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                      Arch                                           Version                                                     Repository                                        Size
================================================================================================================================================================================================================================
Installing:
 php70w                                                       x86_64                                         7.0.33-1.w7                                                 webtatic                                         2.8 M
 php70w-cli                                                   x86_64                                         7.0.33-1.w7                                                 webtatic                                         2.9 M
 php70w-common                                                x86_64                                         7.0.33-1.w7                                                 webtatic                                         1.2 M
 php70w-devel                                                 x86_64                                         7.0.33-1.w7                                                 webtatic                                         2.6 M
 php70w-fpm                                                   x86_64                                         7.0.33-1.w7                                                 webtatic                                         1.5 M
 php70w-gd                                                    x86_64                                         7.0.33-1.w7                                                 webtatic                                         135 k
 php70w-ldap                                                  x86_64                                         7.0.33-1.w7                                                 webtatic                                          36 k
 php70w-mbstring                                              x86_64                                         7.0.33-1.w7                                                 webtatic                                         544 k
 php70w-mcrypt                                                x86_64                                         7.0.33-1.w7                                                 webtatic                                          28 k
 php70w-mysqlnd                                               x86_64                                         7.0.33-1.w7                                                 webtatic                                         207 k
 php70w-opcache                                               x86_64                                         7.0.33-1.w7                                                 webtatic                                         131 k
 php70w-pdo                                                   x86_64                                         7.0.33-1.w7                                                 webtatic                                          93 k
 php70w-pecl-mongodb                                          x86_64                                         1.5.3-1.w7                                                  webtatic                                         506 k
 php70w-pecl-redis                                            x86_64                                         3.1.6-1.w7                                                  webtatic                                         179 k
Installing for dependencies:
 httpd                                                        x86_64                                         2.4.6-97.el7.centos                                         updates                                          2.7 M
 httpd-tools                                                  x86_64                                         2.4.6-97.el7.centos                                         updates                                           93 k
 libmcrypt                                                    x86_64                                         2.5.8-13.el7                                                epel                                              99 k
 mailcap                                                      noarch                                         2.1.41-2.el7                                                base                                              31 k
 pcre-devel                                                   x86_64                                         8.32-17.el7                                                 base                                             480 k
 php70w-pear                                                  noarch                                         1:1.10.4-1.w7                                               webtatic                                         340 k
 php70w-pecl-igbinary                                         x86_64                                         2.0.5-1.w7                                                  webtatic                                          88 k
 php70w-process                                               x86_64                                         7.0.33-1.w7                                                 webtatic                                          43 k
 php70w-xml                                                   x86_64                                         7.0.33-1.w7                                                 webtatic                                         131 k

Transaction Summary
================================================================================================================================================================================================================================
Install  14 Packages (+9 Dependent packages)

Total download size: 17 M
Installed size: 68 M
Downloading packages:
(1/23): pcre-devel-8.32-17.el7.x86_64.rpm                                                                                                                                                                | 480 kB  00:00:00     
(2/23): httpd-tools-2.4.6-97.el7.centos.x86_64.rpm                                                                                                                                                       |  93 kB  00:00:00     
(3/23): mailcap-2.1.41-2.el7.noarch.rpm                                                                                                                                                                  |  31 kB  00:00:00     
(4/23): libmcrypt-2.5.8-13.el7.x86_64.rpm                                                                                                                                                                |  99 kB  00:00:01     
(5/23): httpd-2.4.6-97.el7.centos.x86_64.rpm                                                                                                                                                             | 2.7 MB  00:00:02     
warning: /var/cache/yum/x86_64/7/webtatic/packages/php70w-common-7.0.33-1.w7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY                                                 ] 664 kB/s | 5.3 MB  00:00:17 ETA 
Public key for php70w-common-7.0.33-1.w7.x86_64.rpm is not installed
(6/23): php70w-common-7.0.33-1.w7.x86_64.rpm                                                                                                                                                             | 1.2 MB  00:00:04     
(7/23): php70w-7.0.33-1.w7.x86_64.rpm                                                                                                                                                                    | 2.8 MB  00:00:05     
(8/23): php70w-fpm-7.0.33-1.w7.x86_64.rpm                                                                                                                                                                | 1.5 MB  00:00:02     
(9/23): php70w-devel-7.0.33-1.w7.x86_64.rpm                                                                                                                                                              | 2.6 MB  00:03:02     
(10/23): php70w-ldap-7.0.33-1.w7.x86_64.rpm                                                                                                                                                              |  36 kB  00:00:01     
(11/23): php70w-mcrypt-7.0.33-1.w7.x86_64.rpm                                                                                                                                                            |  28 kB  00:00:00     
(12/23): php70w-mbstring-7.0.33-1.w7.x86_64.rpm                                                                                                                                                          | 544 kB  00:00:02     
(13/23): php70w-opcache-7.0.33-1.w7.x86_64.rpm                                                                                                                                                           | 131 kB  00:00:00     
(14/23): php70w-pdo-7.0.33-1.w7.x86_64.rpm                                                                                                                                                               |  93 kB  00:00:00     
(15/23): php70w-mysqlnd-7.0.33-1.w7.x86_64.rpm                                                                                                                                                           | 207 kB  00:00:01     
(16/23): php70w-pecl-igbinary-2.0.5-1.w7.x86_64.rpm                                                                                                                                                      |  88 kB  00:00:00     
(17/23): php70w-pear-1.10.4-1.w7.noarch.rpm                                                                                                                                                              | 340 kB  00:00:00     
(18/23): php70w-pecl-redis-3.1.6-1.w7.x86_64.rpm                                                                                                                                                         | 179 kB  00:00:00     
(19/23): php70w-process-7.0.33-1.w7.x86_64.rpm                                                                                                                                                           |  43 kB  00:00:00     
(20/23): php70w-pecl-mongodb-1.5.3-1.w7.x86_64.rpm                                                                                                                                                       | 506 kB  00:00:00     
(21/23): php70w-xml-7.0.33-1.w7.x86_64.rpm                                                                                                                                                               | 131 kB  00:00:00     
(22/23): php70w-gd-7.0.33-1.w7.x86_64.rpm                                                                                                                                                                | 135 kB  00:00:12     
(23/23): php70w-cli-7.0.33-1.w7.x86_64.rpm                                                                                                                                                               | 2.9 MB  00:04:36     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                            62 kB/s |  17 MB  00:04:37     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7
Importing GPG key 0x62E74CA5:
 Userid     : "Webtatic EL7 <rpms@webtatic.com>"
 Fingerprint: 830d b159 6d9b 9b01 99dc 24a3 e87f d236 62e7 4ca5
 Package    : webtatic-release-7-3.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : php70w-common-7.0.33-1.w7.x86_64                                                                                                                                                                            1/23 
  Installing : php70w-cli-7.0.33-1.w7.x86_64                                                                                                                                                                               2/23 
  Installing : php70w-process-7.0.33-1.w7.x86_64                                                                                                                                                                           3/23 
  Installing : php70w-pdo-7.0.33-1.w7.x86_64                                                                                                                                                                               4/23 
  Installing : php70w-xml-7.0.33-1.w7.x86_64                                                                                                                                                                               5/23 
  Installing : 1:php70w-pear-1.10.4-1.w7.noarch                                                                                                                                                                            6/23 
  Installing : php70w-pecl-igbinary-2.0.5-1.w7.x86_64                                                                                                                                                                      7/23 
  Installing : httpd-tools-2.4.6-97.el7.centos.x86_64                                                                                                                                                                      8/23 
  Installing : libmcrypt-2.5.8-13.el7.x86_64                                                                                                                                                                               9/23 
  Installing : pcre-devel-8.32-17.el7.x86_64                                                                                                                                                                              10/23 
  Installing : mailcap-2.1.41-2.el7.noarch                                                                                                                                                                                11/23 
  Installing : httpd-2.4.6-97.el7.centos.x86_64                                                                                                                                                                           12/23 
  Installing : php70w-7.0.33-1.w7.x86_64                                                                                                                                                                                  13/23 
  Installing : php70w-devel-7.0.33-1.w7.x86_64                                                                                                                                                                            14/23 
  Installing : php70w-mcrypt-7.0.33-1.w7.x86_64                                                                                                                                                                           15/23 
  Installing : php70w-pecl-redis-3.1.6-1.w7.x86_64                                                                                                                                                                        16/23 
  Installing : php70w-pecl-mongodb-1.5.3-1.w7.x86_64                                                                                                                                                                      17/23 
  Installing : php70w-mysqlnd-7.0.33-1.w7.x86_64                                                                                                                                                                          18/23 
  Installing : php70w-gd-7.0.33-1.w7.x86_64                                                                                                                                                                               19/23 
  Installing : php70w-fpm-7.0.33-1.w7.x86_64                                                                                                                                                                              20/23 
  Installing : php70w-mbstring-7.0.33-1.w7.x86_64                                                                                                                                                                         21/23 
  Installing : php70w-ldap-7.0.33-1.w7.x86_64                                                                                                                                                                             22/23 
  Installing : php70w-opcache-7.0.33-1.w7.x86_64                                                                                                                                                                          23/23 
  Verifying  : php70w-cli-7.0.33-1.w7.x86_64                                                                                                                                                                               1/23 
  Verifying  : mailcap-2.1.41-2.el7.noarch                                                                                                                                                                                 2/23 
  Verifying  : pcre-devel-8.32-17.el7.x86_64                                                                                                                                                                               3/23 
  Verifying  : php70w-pecl-mongodb-1.5.3-1.w7.x86_64                                                                                                                                                                       4/23 
  Verifying  : libmcrypt-2.5.8-13.el7.x86_64                                                                                                                                                                               5/23 
  Verifying  : php70w-process-7.0.33-1.w7.x86_64                                                                                                                                                                           6/23 
  Verifying  : php70w-gd-7.0.33-1.w7.x86_64                                                                                                                                                                                7/23 
  Verifying  : php70w-mcrypt-7.0.33-1.w7.x86_64                                                                                                                                                                            8/23 
  Verifying  : php70w-mysqlnd-7.0.33-1.w7.x86_64                                                                                                                                                                           9/23 
  Verifying  : httpd-2.4.6-97.el7.centos.x86_64                                                                                                                                                                           10/23 
  Verifying  : php70w-7.0.33-1.w7.x86_64                                                                                                                                                                                  11/23 
  Verifying  : php70w-fpm-7.0.33-1.w7.x86_64                                                                                                                                                                              12/23 
  Verifying  : php70w-pdo-7.0.33-1.w7.x86_64                                                                                                                                                                              13/23 
  Verifying  : php70w-pecl-redis-3.1.6-1.w7.x86_64                                                                                                                                                                        14/23 
  Verifying  : php70w-xml-7.0.33-1.w7.x86_64                                                                                                                                                                              15/23 
  Verifying  : php70w-mbstring-7.0.33-1.w7.x86_64                                                                                                                                                                         16/23 
  Verifying  : php70w-common-7.0.33-1.w7.x86_64                                                                                                                                                                           17/23 
  Verifying  : httpd-tools-2.4.6-97.el7.centos.x86_64                                                                                                                                                                     18/23 
  Verifying  : php70w-ldap-7.0.33-1.w7.x86_64                                                                                                                                                                             19/23 
  Verifying  : 1:php70w-pear-1.10.4-1.w7.noarch                                                                                                                                                                           20/23 
  Verifying  : php70w-pecl-igbinary-2.0.5-1.w7.x86_64                                                                                                                                                                     21/23 
  Verifying  : php70w-devel-7.0.33-1.w7.x86_64                                                                                                                                                                            22/23 
  Verifying  : php70w-opcache-7.0.33-1.w7.x86_64                                                                                                                                                                          23/23 

Installed:
  php70w.x86_64 0:7.0.33-1.w7              php70w-cli.x86_64 0:7.0.33-1.w7        php70w-common.x86_64 0:7.0.33-1.w7  php70w-devel.x86_64 0:7.0.33-1.w7    php70w-fpm.x86_64 0:7.0.33-1.w7      php70w-gd.x86_64 0:7.0.33-1.w7  
  php70w-ldap.x86_64 0:7.0.33-1.w7         php70w-mbstring.x86_64 0:7.0.33-1.w7   php70w-mcrypt.x86_64 0:7.0.33-1.w7  php70w-mysqlnd.x86_64 0:7.0.33-1.w7  php70w-opcache.x86_64 0:7.0.33-1.w7  php70w-pdo.x86_64 0:7.0.33-1.w7 
  php70w-pecl-mongodb.x86_64 0:1.5.3-1.w7  php70w-pecl-redis.x86_64 0:3.1.6-1.w7 

Dependency Installed:
  httpd.x86_64 0:2.4.6-97.el7.centos         httpd-tools.x86_64 0:2.4.6-97.el7.centos   libmcrypt.x86_64 0:2.5.8-13.el7   mailcap.noarch 0:2.1.41-2.el7   pcre-devel.x86_64 0:8.32-17.el7   php70w-pear.noarch 1:1.10.4-1.w7  
  php70w-pecl-igbinary.x86_64 0:2.0.5-1.w7   php70w-process.x86_64 0:7.0.33-1.w7        php70w-xml.x86_64 0:7.0.33-1.w7  

Complete!
[root@localhost /]# 
[root@localhost /]# php -v
PHP 7.0.33 (cli) (built: Dec  6 2018 22:30:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies

[root@localhost /]# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
[root@localhost /]# vim /etc/nginx/nginx.conf
[root@localhost /]# systemctl start nginx
[root@localhost /]# systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[root@localhost /]#

[root@localhost /]# grep 'temporary password' /var/log/mysqld.log
2020-11-23T08:39:37.195652Z 1 [Note] A temporary password is generated for root@localhost: RzIA7&xYl*sL
[root@localhost /]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: 
Error: Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost /]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: 

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.

Estimated strength of the password: 100 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 

[root@localhost /]# vim /usr/share/nginx/html/phpinfo.php
[root@localhost /]# systemctl start php-fpm
[root@localhost /]# systemctl enable php-fpm
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.

[root@localhost /]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.92.128  netmask 255.255.255.0  broadcast 192.168.92.255
        inet6 fe80::2f73:d496:5ac7:8ecf  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:31:6a:c9  txqueuelen 1000  (Ethernet)
        RX packets 724330  bytes 1037801840 (989.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 232522  bytes 14953173 (14.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 48  bytes 4080 (3.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 4080 (3.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:74:2b:70  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost /]# rm -rf /usr/share/nginx/html/phpinfo.php
[root@localhost /]# 

推荐阅读更多精彩内容