项目:
CentOS 7, apm + xcache, rpm包, php module
a) 一个虚拟主机提供phpMyAdmin,另一个虚拟主机提供wordpress;
b) 为phpMyAdmim提供https服务
该项目步骤具体如下:
1、进行该项目,目标主机要能和网络连接,需关闭防火墙,然后yum各软件包。
# iptables -F
# setenforce 0
# yum install httpd php php-mysql mariadb -------注意开发环境的安装
2、对于未开启的服务进行开启,否则报错
# systemctl start httpd
# systemctl start mariadb
3、对两个虚拟主机配置文件进行配置:
<VirtualHost 172.16.72.1:80>
DocumentRoot "/myweb/vhosts/www"
ServerName www.qhdlink.com
DirectoryIndex index.php
ProxyRequests Off
ProxyPassMatch ^/(.*\.php) fcgi://127.0.0.1:9000/myweb/vhosts/www/$1
<Directory "/myweb/vhosts/www">
Options None
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
4、wordpress
# mkdir /data/vhosts/www1
# tar xf wordpress-4.3.1.tar.gz
# cp wordpress /data/vhosts/www1
# mysql -p
mysql> create database wpdb ----------创建库
mysql> grant all on wpdb.* to ‘wpuser‘@‘172.16.%.%‘ identified by ‘wppass‘ ------------授权
# cp wp-config-sample.php wp-config.php ----------修改配置文件
5、测试php和mysql之间的通信
测试php:
<?php
phpinfo();
?>
测试mysql连接性:
<?php
$conn = mysql_connect(‘172.16.100.71‘,‘testuser‘,‘testpass‘);
if($conn)
echo "OK";
else
echo "Failure";
?>
索引http://www1.qhdlink.com/wordpress/index.php
6、phpMyAdmin
# mkdir /data/vhosts/www2
# tar xf phpMyAdmin-4.4.14.1.tar.gz
# cp -r phpMyAdmin-4.4.14.1 /data/vhosts/www1
www]# ln -sv phpMyAdmin-4.4.14.1-all-languages/ phpMyAdmin ----------注意文件目录连接位置
# cp config.sample.inc.php config.inc.php
# openssl rand -hex 8
# vim config.inc.php
$cfg[‘blowfish_secret‘] = ‘640b56f72820ace8‘
检索http://www1.qhdlink.com/phpMyAdmin-4.4.14.1/
7、xcache加速器
# yum install php-xcache
# ab -c 50 -n 100 www2.qhdlink.com/wordpress/index.php
原文地址:http://12496428.blog.51cto.com/12486428/1965110