CENTOS-6 platform three-machine compiling and installing FASTCGI model

Source: Internet
Author: User
Tags install wordpress

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
    • Binary installation mariadb

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"/>

    • Initializing database security Settings

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"/>


    • Configure MARIADB

# 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
    • Test Connection Mariadb

[email protected] ~]# yum install-y mysql[[email protected] ~]# mysql-uroot-h172.18.253.35-pmageedu
    • Environment configuration: Install Development Kit

# yum-y Groupinstall "Server Platform Development" "Development tools" # Yum-y install Bzip2-devel libmcrypt-devel libxml 2-devel
    • Compiling and installing PHP

    • 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7F/71/wKioL1cfB9OTwq-zAAAIVKZZ27M137.jpg "title=" 1.jpg " alt= "Wkiol1cfb9otwq-zaaaivkzz27m137.jpg"/>


~]# 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
    • Configure PHP, PHP-FPM

# 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
    • Installing Php-mysql

]# yum-y Install Php-mysql
    • Compiling and installing Xache

# 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
    • Environment configuration: Install Development Kit

# yum-y Groupinstall "Server Platform Development" "Development tools" # Yum-y Install Pcre-devel
    • Compiling and installing httpd2.4

    • (1) apr-1.4+

#./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"
    • (2) apr-util-1.4+

#./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
    • (3) httpd-2.4 (can be specified in the installation of the user to run, not specified by default is the daemon user)

#./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
    • Set HTTPD24 service start and boot default boot method

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/72/wKioL1cfF8Px34M0AADKT4D5DTw462.png "title=" 1.png " alt= "Wkiol1cff8px34m0aadkt4d5dtw462.png"/>

    • To see if validation is a worker model

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"/>

    • Install WordPress (The installation method is provided, the installation package downloads itself)

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"/>

    • Install phpMyAdmin (the installation method is provided here, the installation package is downloaded by itself)

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"/>

    • Configuring a virtual Host 1

[[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 '
    • Configure virtual Host 2

[[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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.