需求:
CentOS 7 lamp(php-fpm)
(1)三者分离于三台主机
(2)一个虚拟主机用于提供phpMyAdmin;另一个虚拟主机用于提供wordpress;
(3)xcache
实验准备:
# setenforce 0 # systemctl stop iptables # systemctl stop firwalld 修改文件: Linux: /etc/hosts windows:\Windows\System32\drivers\etc\hosts 添加内容: 10.0.0.61 10.0.0.61
实验环境
三者分离于三台主机
host1: 10.0.0.61 httpd host2: 10.0.0.62 php-fpm host3: 10.0.0.63 mariadb
Host1
# yum install httpd -y
Host2
# yum install php-fpm php-mysql php-mbstring -y
编辑配置文件:
# vim /etc/php-fpm.d/www.conf listen = 127.0.0.1:9000 listen.allowed_clients = 127.0.0.1 修改为 listen = 10.0.0.62:9000 //本地的ip地址,监听在哪个端口 listen.allowed_clients = 10.0.0.61 //允许哪个地址的访问
systemctl start php-fpm
Host3
# yum install mariadb-server -y # systemctl start mariadb mysql> create user root@‘10.0.0.%‘; mysql> grant all on *.* to root@‘10.0.0.%‘ identified by ‘123456‘ mysql> create user ‘wordpress‘@‘10.0.0.62‘; mysql> create database wordpress; mysql> grant all on wordpress.* to ‘wordpress‘@‘10.0.0.62‘ identified by ‘wordpress‘
创建虚拟主机
原文地址:http://wscto.blog.51cto.com/11249394/1783553