LAMP-CENTOS-7 platform Dual-machine module model

Source: Internet
Author: User

Demand:

CentOS 7 lamp (module)

(1) The three are separated from two main units

(2) A virtual host is used to provide phpmyadmin; another virtual machine is used to provide WordPress;

(3) XCache

(4) Provide HTTPS virtual host for phpMyAdmin


Environment Preparation:

One: Turn off SELinux and iptables

Setenforce 0systemctl Stop Iptables


Second: In order to facilitate testing, modify the native hosts, you can also build a DNS Server

To modify a file:

Linux:/etc/hostswindows: \windows\system32\drivers\etc\host

Add Content:

172.18.64.61 phpadmin.com172.18.64.62 wordpress.com


Lab Environment:

Host1:apache + PHP 172.18.64.61host2:mariadb 172.18.64.62host3: Private CA 172.18.64.63


Host 1

# yum Install httpd php php-mysql-y

Host 2

# yum Install mariadb-server# systemctl start mariadbmysql> create user ' root ' @ ' 172.18.64.% ';mysql> grant all on * *      To ' root ' @ ' 172.18.64.% ' identified by ' 123456 '; Phpadminmysql> CREATE DATABASE wordpress;mysql> create user ' wordpress ' @ ' 172.18.64.% ';mysql> grant all on   wordpress.* to ' WordPress ' @ ' 172.18.64.% ' identified by ' WordPress '; Wordpress


Create a virtual host

A virtual machine is used to provide phpMyAdmin, and another virtual host is used to provide WordPress


Host1

One: Comment/etc/httpd/conf/httpd.conf line 119th

# documentroot "/var/www/html"

Two: Configure the virtual host

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/80/FA/wKiom1dFnJDh0ZduAACzhRJ-b5U198.jpg "title=" 7HFPUK6%3@STM95G6WK2I_K.jpg "alt=" Wkiom1dfnjdh0zduaaczhrj-b5u198.jpg "/>

Mkdir-pv/www/host1/phpadmin WordPress


Three: Access to the source code

Phpadmin

Official website: http://www.phpmyadmin.net

# cd/www/host1/phpadmin# wget # unzip phpmyadmin-4.6.0-all-languages.zip# MV Phpmyadmin-4.6.0-all-languages PhpMyAdmin # CD phpmyadmin# CP config.sample.inc.php config.inc.php generate random number # OpenSSL rand-base64 206RR4NXJL7YEDSBXNQLXIMZ8TEVW adds the generated random number to the config.inc.php: $cfg [' blowfish_secret '] = ' js/yatgot2ubjmkkqkejffx9rka '; Specify the IP address of the database $cfg[' Servers ' [$i] [' host '] = ' 10.0.0.62 ';


Wordpress

Official website: https://cn.wordpress.org

# cd/www/host1/wordpress# wget # Unzip wordpress-4.5-zh_cn.tar.gz



Pressure test

Ab

-N: Total number of requests

-C: Analog parallel number

# ab-n 100-c http://www.phpadmin.com/index.phpRequests per second:70.21 [#/sec] (mean)//sec processing Requests 70.21


Compiling and installing XCache

Official website:http://xcache.lighttpd.net/

# yum Install php-devel-y//xcache relies on php-devel# wget # tar XF xcache-3.2.0.tar.bz2# cd xcache-3.2.0# phpiz#./configu Re--enable-xcache--with-php-config= ' which php-config ' # make && make install# CP xcache.ini/etc/php.d# SYSTEMCT L Reload httpdrequests per second:377.42 [#/sec] (mean)//performance increased by five times times

Note that the XCache RPM package in the Epel source may be problematic and performance does not rise




LAMP-CENTOS-7 platform Dual-machine module 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.