LAMP (2)--centos-6 platform three-machine compiling and installing FASTCGI model
Requirements:
(1) Three separate from the host; (Compile and install, module or PHP-FPM);
(2) A virtual host is used to provide phpmyadmin; Another virtual host is used to provide WordPress;
(3) XCache;
(4) Try MPM as a non-prefork mechanism;
Environmental Planning:
Host |
IP |
Software |
Platform |
Host 1 |
172.18.253.33 |
httpd |
CentOS 6 |
Host 2 |
172.18.253.34 |
php-fpm |
CentOS 6 |
Host 3 |
172.18.253.35 |
Mariadb |
CentOS 6 |
Configuration Preparation:
1. Before the experiment, the iptables and SELinux are set to the off state to avoid affecting the experimental results.
2. First configure MARIADB Server host 3, then configure PHP-FPM Server Host 2, and finally configure HTTPD Server Host 1, in order from back to front.
Host 3 Configuration:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/73/wKiom1ce-vzjT8xFAABp1EG5dvw925.png "title=" 1.png " alt= "Wkiom1ce-vzjt8xfaabp1eg5dvw925.png"/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7F/70/wKioL1ce--3jDzrBAAG-tEvRgbs357.png "title=" 1.png " alt= "Wkiol1ce--3jdzrbaag-tevrgbs357.png"/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/73/wKiom1ce-0iBGDRQAAHgM_rzFXU006.png "title=" 1.png " alt= "Wkiom1ce-0ibgdrqaahgm_rzfxu006.png"/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/70/wKioL1ce_DDzNJGxAAArBu9gPjY122.png "title=" 1.png " alt= "Wkiol1ce_ddznjgxaaarbu9gpjy122.png"/>
Mysql_secure_installation
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/7F/70/wKioL1ce_wrgxy-WAAE7q9m07NQ138.jpg "title=" 1.jpg " alt= "Wkiol1ce_wrgxy-waae7q9m07nq138.jpg"/>
# Grant Root allows all databases to be logged on from a host in the 172.18.253.0/24 network segment. MariaDB [(None)]> grant all privileges on * * to ' root ' @ ' 172.18.253.% ' identified by ' mageedu '; # Create data wpdb for WordPress. MariaDB [(None)]> CREATE database wpdb;# to wordpress creating user WP. MariaDB [(None)]> create user ' WP ' @ ' 172.18.253.% ' identified by ' mageedu '; # authorize WP to 172.18.253.0/24 the database from the host login operation within the WPDB network segment. MariaDB [(None)]> grant all privileges on wpdb.* to ' WP ' @ ' 172.18.253.% ' identified by ' mageedu '; # Overloaded permissions table MariaDB [(None)] > Flush privileges;# Exit mariadb [(none)]> \q
Host 2 configuration:
[email protected] ~]# yum install-y mysql[[email protected] ~]# mysql-uroot-h172.18.253.35-pmageedu
# yum-y Groupinstall "Server Platform Development" "Development tools" # Yum-y install Bzip2-devel libmcrypt-devel libxml 2-devel
~]# tar-xf php-5.4.40.tar.bz2~]#./configure--prefix=/usr/local/php5--with-openssl--with-mysql=mysqlnd-- With-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir-- With-zlib--with-libxml-dir=/usr--enable-xml--enable-sockets--enable-fpm--with-mcrypt--with-config-file-path=/ etc--with-config-file-scan-dir=/etc/php.d--with-bz2--enable-maintainer-zts~]# make && make install
# CP php.ini-production/etc/php.ini]# mkdir/etc/php.d/]# cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/ etc/php-fpm.conf]# vim/usr/local/php/etc/php-fpm.conf# configuration Enable PID file and error_logpid =/usr/local/php/var/run/ Php-fpm.piderror_log =/usr/local/php/var/log/php-fpm/error.log
]# yum-y Install Php-mysql
# yum Install Php-devel # cd xcache-3.2.0 # phpize (Generate configure script in current directory, let it know PHP environment) #./configure–enable-xcache–with-php- Config=/usr/bin/php-config # make && make install # CP xcache.ini/etc/php.d/
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7F/74/wKiom1cfGI7icZb0AAHVnSwSe1E185.jpg "title=" 44d919fd-1d39-458a-83e1-01929eef2d21.jpg "alt=" wkiom1cfgi7iczb0aahvnswse1e185.jpg "/>
Host 1 configuration:
# yum-y Groupinstall "Server Platform Development" "Development tools" # Yum-y Install Pcre-devel
#./configure--prefix=/usr/local/apr "indicates installation to/USR/LOCAL/APR directory" # make && make install "The first command executes the second if it runs successfully"
#./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR "When a package is installed, tell him where it is,--with-apr=/usr/local/ Apr means to tell the dependent package that the APR package is in the/USR/LOCAL/APR directory "# make && make install
#./configure–prefix=/usr/local/apache24–sysconfdir=/etc/httpd24–enable-so–enable-ssl–enable-cgi– Enable-rewrite (URL rewrite supported) –with-zlib–with-pcre–with-apr=/usr/local/apr–with-apr-util=/usr/local/apr-util– enable-modules=most–enable-mpms-shared=all–with-mpm=worker# make && make install
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/72/wKioL1cfF8Px34M0AADKT4D5DTw462.png "title=" 1.png " alt= "Wkiol1cff8px34m0aadkt4d5dtw462.png"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7F/72/wKioL1cfGEqT4XUCAAFB_eA0k_c336.jpg "title=" 1.jpg " alt= "Wkiol1cfgeqt4xucaafb_ea0k_c336.jpg"/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7F/56/wKioL1caPdrws4g9AACYyVQ64os514.png "title=" 1.png " alt= "Wkiol1capdrws4g9aacyyvq64os514.png" width= "650"/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/60/wKioL1cciDTA92w8AAAG04_-USQ235.png "title=" 1.png " alt= "Wkiol1ccidta92w8aaag04_-usq235.png" width= "650"/>
CP Phpmyadmin-4.4.14.1-all-language.zip/webcom/c.org/pmaunzip PHPMYADMIN-4.4.14.1-ALL-LANGUAGE.ZIPLN-SV Phpmyadmin-4.4.14.1-all-language phpadmincd phpadmin/cp config.sample.inc.php config.inc.phpopenssl rand-base64 15vim config.inc.phpsystemctl Restart Httpd.service
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/74/wKiom1cfGWfDL2zAAAA-1BejEHc750.png "title=" 1.png " alt= "Wkiom1cfgwfdl2zaaaa-1bejehc750.png"/>
[[email protected] ~]# vim /etc/httpd/conf.d/virtualhost1.conf<virtualhost *:80 > ServerName www.b.net DocumentRoot "/webcom/b.net/wp" < directory "/webcom/b.net/wp" > Options None AllowOverride None Require all granted </directory></virtualhost>[[email protected] ~]# mkdir -pv / webcom/b.net/wpmkdir: created directory '/webcom/b.net ' mkdir: created directory '/webcom/b.net/wp '
[[email protected] ~]# vim /etc/httpd/conf.d/virtualhost2.conf<virtualhost *:80 > ServerName www.c.org DocumentRoot "/WEBCOM/C.ORG/PMA" < directory "/webcom/c.org/" > Options None AllowOverride None Require all granted </directory></virtualhost>[[email protected] ~]# mkdir -pv / webcom/c.org/pmamkdir: created directory '/webcom/c.org ' mkdir: created directory '/WEBCOM/C.ORG/PMA '
At this point, the experiment is complete!
CENTOS-6 platform three-machine compiling and installing FASTCGI model