一、 环境
二、流程(思路)
1、先安装LNMP(192.168.1.22+192.168.1.24+122.51.223.193),安装wordpress
2、配置nginx负载均衡
3、添加php均衡
4、配置mariadb主从
三、安装lnmp及wordpress
1、安装nginx(192.168.1.22)
1)、Nginx安装
Nginx这里使用阿里的epel源直接yum安装
[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum install –y nginx-1.16.1 安装nginx-1.16.1版本
下载wordpress并放至项目目录
[root@localhost src]# wget -c https://wordpress.org/latest.tar.gz -O /usr/share/nginx/html/wordpress.tar.gz
[root@localhost src]# cd /usr/share/nginx/html/
[root@localhost html]# tar xf wordpress.tar.gz
[root@localhost html]# chown -R nginx:nginx wordpress
2)、配置
vim /etc/nginx/nginx.conf
[root@localhost html]# vim /etc/nginx/nginx.conf
location / {
root /usr/share/nginx/html/wordpress;
index index.php;
}
location ~ \.php$ {
root /data/nginx/html/wordpress/; PHP的目录
fastcgi_pass 192.168.1.24:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
2、安装PHP(192.168.1.24)
1)、更换清华源,安装php5.6,默认是5.4
[root@localhost ~]# yum install https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm
[root@localhost yum.repos.d]# vim remi.repo
30 enabled=1
安装php</