Lamp Integration Mode 2
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) Install XCache speed up PHP access
Test machine Preparation:
172.18.29.122:PHPFPM PHP fastcgi Application Server
172.18.29.121:HTTPD http Server for PHP
172.18.29.120:MARIADB Database Service Area
First, install HTTPD server
Install the HTTPD server on the 122 server CentOS7, install the withheld, and see the previous blog post.
Add Virtual Host: vim/etc/httpd/conf.d/vhost.conf set the FQDN virtual machine as follows:
Listen 80<virtualhost *:80> ServerName www.admin121.com documentroot "/webs/admin" <director Y "/webs/admin" > Options none allowoverride none Require all granted </Directory></VirtualHost>
To establish the host root directory:
Mkdir-p/webs/admin
Start with an initial page index.html
Cho "
Start the httpd server and you can see the http://www.admin121.com/admin.html response. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7F/6E/wKioL1ce0P6jMQ3TAABNT6lH7KM659.png "title=" Admin121.png "alt=" Wkiol1ce0p6jmq3taabnt6lh7km659.png "/>
Second, installation php-fpm
Performed on server 122: yum-y install PHP-FPM
View PHP-FPM installed those files:
~]# RPM-QL php-fpm/etc/logrotate.d/php-fpm/etc/php-fpm.conf/etc/php-fpm.d/etc/php-fpm.d/www.conf/etc/sysconfig/ php-fpm/run/php-fpm/usr/lib/systemd/system/php-fpm.service/usr/lib/tmpfiles.d/php-fpm.conf/usr/sbin/php-fpm/ usr/share/doc/php-fpm-5.4.16/usr/share/doc/php-fpm-5.4.16/fpm_license/usr/share/doc/php-fpm-5.4.16/ php-fpm.conf.default/usr/share/fpm/usr/share/fpm/status.html/usr/share/man/man8/php-fpm.8.gz/var/log/php-fpm
PHP-FPM configuration file is mainly:/etc/php-fpm.conf,/etc/php-fpm.d/www.conf two files, systemd boot file /usr/lib/systemd/system/ Php-fpm.service, as well as its configuration file /usr/lib/systemd/system/php-fpm.service, can execute program file/USR/SBIN/PHP-FPM. Here you only need to modify/etc/php-fpm.d/www.conf
, the PHP-FPM configuration file belongs to the INI format configuration file, mainly the address pool configuration
Listen = 172.18.29.122:9000 # Modify host listening port
Listen.allowed_clients =172.18.29.121 # Allow client address
Pm=dymic # Process Manager's working mode, PHP-FPM is a multi-process model processing mechanism
Pm.max_children = 50 # Maximum number of child processes
Pm.start_servers = 5 # When started, the number of processes
pm.min_spare_servers = 5 # Minimum number of free processes
Pm.max_spare_servers = 35 # Maximum number of free processes
;p m.max_requests = 500 # child process maximum number of responses, exceeding the number of responses, killing the child process, and generating a new child process to continue serving.
Start server: Systemctl start PHP-FPM
In order to be able to direct PHP to 122PHP-FPM CGI program processing on the peer-to httpd, you need to add the configuration to the virtual host:
listen 80<virtualhost *:80> servername www.admin121.com documentroot "/webs/admin" DirectoryIndex index.php proxyrequests off proxypassmatch ^/(. *\.php) fcgi://172.18.29.122:9000/webs/admin/$1 < directory "/webs/admin" > Options None AllowOverride None Require all granted </directory></virtualhoSt>
Restart the HTTPD service in establishing the/webs/admin122/index.php test for the 122 server:
echo "<?php phpinfo ();? > ">/webs/admin122/index.php650" this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7F/6F/wKioL1ce3_ Dbgx6kaacxgqyh_bu173.png "title=" Php-fpm.png "alt=" Wkiol1ce3_dbgx6kaacxgqyh_bu173.png "/>
You can see the PHP page that you are working with fpm/fastcgi.
Third, installation Wordpress/phpmyadmin
1. Install WordPress
You need to use PHP-FPM to connect to the database, so you need to install Php-mysql to connect to the dynamic library: yum-y Install Php-mysql
Install Mariadb-server on 120 server, build wordpress database, authorize WordPress database User:
Systemctl Start mariadb
Mysql-uroot
Create Database wpdb;
Grant all on wpdb.* to ' wpadmin ' @ ' 172.18.29.122 ' identified by ' 123456 '
Flush privileges;
Install WordPress:
Unzip the installation package to 122/webs/admin/wordpress/, modify the file wp-config-sample.php for wp-config.php will be inside the database, database user name password information modified to 121 host corresponding to the same directory.
Under the access, as shown, it can be used!
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7F/6F/wKioL1ce4-7TSXEOAACMBzP4Cig920.png "title=" Wordpress.png "alt=" Wkiol1ce4-7tsxeoaacmbzp4cig920.png "/>
2. Installing phpMyAdmin
Install Php-mbstring package to 122 host restart PHP-FPM server
Unzip the phpMyAdmin installation package to the 122web root directory
You can do it.
Iv. install XCache for PHP site acceleration
Installing the Php-devel Package
Download xcahce3.2 Source Package
Tar XF xcache3.2&&cd xcache3.2phpize./configure--enable-xcache && make && make INSTALLCP XCache . ini/etc/php.d/
Restart PHP-FPM
This way you can see that the XCache has been shown in the Phpinfo. 650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/71/wKioL1cfDguRNYtMAACIACOushA107.png "title=" Xcache.png "alt=" Wkiol1cfdgurnytmaaciacousha107.png "/>
This article is from "Deep sea Fish" blog, declined reprint!
Lamp Integration Three bursts (2)