(三):安装php模块
安装php,让php基于模块来运行。
配置apache,/etc/http2.4/httpd.conf 让Apache可以识别php
1、添加如下二行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

2、定位至DirectoryIndex index.html
修改为:
DirectoryIndex index.php index.html
而后重新启动httpd,或让其重新载入配置文件即可测试php是否已经可以正常使用。 
(四):安装数据库:
在CentOS7上我们选择yum包安装。
提供配置文件:
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
cp support-files/my-large.cnf /etc/my.cnf
# vim /etc/my.cnf 添加下边参数指定数据目录
datadir=/mydata/data
进入mysql,创建用户给予所有权限,对所有库有所有权限。
GRANT ALL ON *.* 'wp3'@'172.16.%.%' IDENTIFIED BY 'wp3'
关闭防火墙:systemctl stop firewalld
[root@localhost mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.39-MariaDB MariaDB Serve
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

[root@localhost ~]# mysql
MariaDB [mysql]> grant all on *.* to ‘wp3’@'172.16.%.%' identified by 'wp3';
二:安装WordPress
复制wordpress程序包到/web/nfs/{wp1,wp2}
解压.复制wp-config-sample.php为wp-config.php
vim wp-config.php

wp1与wp2配置都一样。
访问OK!

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-09/106175.htm
