CentOS 7, lamp (PHP-FPM);
Requirements: (1) Three separate from the host;
(2) A virtual host is used to provide phpmyadmin; Another virtual host is used to provide WordPress;
(3) XCache
First, the preparatory work:
Prepare three server a,b,c, respectively, for installing HTTPD,PHP-FPM,MARIADB. Configure network and Yum sources, and turn off SELinux and firewalls
Second, install and configure HTTPD server
1. Installation httpd Service
Yum Install Httpd-y
2. Edit the httpd configuration file and create 2 virtual hosts, creating a new/etc/httpd/conf.d/vhost.conf
<virtualhost 172.18.24.10:80>
documentroot/var/www/html/
ServerName www.blog.com
Proxyrequests off
Proxypassmatch ^/(. *\.php) $ fcgi://172.18.24.11:9000/var/www/html/$1
</VirtualHost>
<virtualhost 172.18.24.10:80>
documentroot/var/www/html/
ServerName www.mysql.com
Proxyrequests off
Proxypassmatch ^/(. *\.php) $ fcgi://172.18.24.11:9000/var/www/html/$1
</VirtualHost>
Third, configure the PHP-FPM service
1. Installation Php-fpm,php-mbstring,php-mysql Service
Yum Install PHP-FMP php-mbstring,php-mysql-y
2, edit the/etc/php-fpm.d/www.conf, modify the following content:
Listen = 172.18.24.11:9000
Listen.allowed_clients = 172.18.24.10
3. Create/var/www/html/
Mldir-pv/var/www/html
4. Place WordPress and phpMyAdmin under this file directory
Iv. Installation and Configuration MARIADB service
1. Install MARIADB on the C server
Yum Install Mariadb-server
2. Start the MARIADB service and enter the MySQL database
Systemctl Start Mariadb.service
CREATE DATABASE WP
Mysql>create DATABASE WP;
Add user wpuser and give permission to Telnet
GRANT all on * * to [e-mail protected] '%.%.%.% ' identified by ' wppasswd ';
Five, configure WordPress
1. First CP configuration file
CP wp-config-sample.php wp-config.php
2. Then edit the configuration file as follows:
* * MySQL Settings-specific information from the host you are using * *//
/** Name of WordPress database */
Define (' db_name ', ' WP ');
/** MySQL Database user name */
Define (' Db_user ', ' wpuser ');
/** MySQL Database password */
Define (' Db_password ', ' wppasswd ');
/** MySQL Host */
Define (' Db_host ', ' 172.18.24.11 ');
Vi. Configuring the phpMyAdmin configuration file
1. A copy of the configuration file CP
CP config.sample.inc.php config.inc.php
2. Then edit the configuration file as follows:
You only need to fill in a random number of numbers to $cfg [' blowfish_secret '] = ' a7knc35a2ofosq ';/* must fill in the this for COOKIE auth! */
Note: You need to copy WordPress and phpMyAdmin to the httpd server.
Vi. Compiling and installing XCache
The steps are as follows:
How to compile and install Xache:
# yum Install Php-devel
# CD xcache-3.2.0
# phpize
#./configure--enable-xcache--with-php-config=/usr/bin/php-config
# Make && make install
# CP Xcache.ini/etc/php.d/
Use php-v to check if XCache is installed successfully
At this point, the installation succeeds.
Quick build of lamp in Centos7 (three separate)