LNMP搭建WordPress
链接:https://pan.baidu.com/s/1yRtV7Z0H466Qp8aKIKrOlQ
提取码:rvhv
1、 环境准备
1.1、 Centos7虚拟机一台
1.2、 把lnmp.tar.gz上传到centos
1.3、 解压lnmp.tar.gz到/opt/下
[root@localhost ~]# tar -zxvf lnmp.tar.gz -C /opt/
1.4、 配置yum
将原本的yum移走到/home
[root@localhost ~]# mv /etc/yum.repo.d/* /home/
编写配置文件lnmp.repo
[root@localhost ~]# vi /etc/yum.repo.d/lnmp.repo
内容:
[lnmp]
name=lnmp
baseurl=file:///opt/lnmp
gpgcheck=0
enabled=1
检查是否有用
[root@localhost ~]# yum repolist
1.5、 关闭防火墙
[root@localhost ~]# systemctr stop firewalld
[root@localhost ~]# systemctr disable firewalld
关闭selinux
[root@localhost ~]# vi /etc/sysconfig/selinux
SELINUX=disabled
2、 部署MySQL服务
[root@localhost ~]# yum -y install mariadb-server
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
安装成功可以使用没有密码
3、 部署Nginx服务
老版本centos7中yum源中没有Nginx包,新版本有包。本实验使用自己的本地yum安装。
[root@localhost ~]# yum -y install nginx
查看版本为1.6
[root@localhost ~]# nginx -v
nginx version: nginx/1.16.1
4、 部署PHP服务
[root@localhost ~]# yum -y install php
查看版本
Centos7安装默认为5版本
[root@localhost ~]# php -v
PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17