什么是LNMP?
Linux+Nginx+MySQL+PHP
实验效果
用LNMP搭建一个Discuz论坛
实验准备(在VMware中进行实验)
RedHat(RHEL)7.4
已经联网
一、更换成阿里云yum源
查询已安装的yum
[root@localhost ~]# rpm -qa | grep yum
PackageKit-yum-1.1.5-1.el7.x86_64
yum-3.4.3-154.el7.noarch
yum-rhn-plugin-2.0.1-9.el7.noarch
yum-utils-1.1.31-42.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-langpacks-0.4.2-7.el7.noarch
使用root权限卸载已安装的yum源
[root@localhost ~]# rpm -qa | grep yum | xargs rpm -e --nodeps
warning: /etc/yum/pluginconf.d/langpacks.conf saved as /etc/yum/pluginconf.d/langpacks.conf.rpmsave
下载并安装阿里的yum源rpm包
(浏览器打开网址:https://mirrors.aliyun.com/centos/7/os/x86_64/Packages
然后一个一个的去搜索下载到本地
最后到Linux里面去建一个rpm文件,然后把下载好的包复制进去)
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
查看rpm包
[root@localhost ~]# mkdir rpm
[root@localhost ~]# cd rpm/
[root@localhost rpm]# ls
python-urlgrabber-3.10-10.el7.noarch.rpm
yum-3.4.3-168.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
yum-utils-1.1.31-54.el7_8.noarch.rpm
安装(必须要强制安装)
[root@localhost rpm]# rpm -ivh *.rpm --force --nodeps
warning: python-urlgrabber-3.10-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%]
2:python-urlgrabber-3.10-10.el7 ################################# [ 40%]
3:yum-plugin-fastestmirror-1.1.31-5################################# [ 60%]
4:yum-3.4.3-168.el7.centos ################################# [ 80%]
5:yum-utils-1.1.31-54.el7_8 ################################# [100%]
下载阿里镜像到/etc/yum.repos.d/目录下
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2020-12-21 14:36:48-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 112.19.3.184, 112.19.3.182, 112.19.3.183, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|112.19.3.184|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
100%[====================&#