centos7 lnmp分离部署及均衡

一、 环境

在这里插入图片描述

二、流程(思路)

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</

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值