lamp示例1
lamp
部署分离的LAMP(wordpress论坛),部署到二台服务器上,php加载xcache模块
- 第一台主机安装mariadb(IP=192.168.20.17)
- 安装mariadb
yum install mariadb-server -y
- 关闭防火墙
systemctl disable firewalld
systemctl stop firewalld
- 配置
# 启用mariadb systemctl start mariadb systemctl enable mariadb # 安全配置mariadb mysql_secure_installation # 配置mariadb的数据 mysql -p -e "create database wpdb; grant all privileges on wpdb.* to wpuser@'%' identified by '123456';"
- 安装mariadb
- 第二台主机安装php,apache,xcache(IP=192.168.20.7)
- 安装软件
yum install httpd php php-mysql php-xcache -y
- 解压wordpress
unzip WordPress-5.0-branch.zip mv WordPress-5.0-branch/* /var/www/html/ setfacl –R –m u:apache:rwx /var/www/html/
- 设置httpd
更改文件 /etc/httpd/conf/httpd.conf:<IfModule dir_module> DirectoryIndex index.php index.html </IfModule>
systemctl enable httpd
systemctl start httpd
- 网页设置wordpress
登录wordpress安装界面-
点 "let's go"
-
输入
项目名 对应值 Database Name wpdb Username wpuser Password 123456 Database Host 192.168.20.17 Table Prefix wp_ 点submit
-
information needeod
项目名 对应值 site title xxxx username chao passowrd 123 your email 123@123.123 -
登录
-
- 安装软件