LAMP (1)--centos-7 two host module model

Source: Internet
Author: User
Tags install wordpress

LAMP (1)--centos-7 two host module model requirements:
  • (1) The three are separated from two host computers;

  • (2) A virtual host is used to provide phpmyadmin; Another virtual host is used to provide WordPress;

  • (3) XCache

  • (4) Provide HTTPS virtual host for phpMyAdmin;

Environmental planning:
Host IP software platform 1 172.18.77.84 httpd+php CentOS 7 host 2 172.18.77.205 mariadb CentOS 7
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 the MARIADB backend Server host 2, and then configure the httpd+php front-end server Host 1, in the order from back to front.

Host 2 configuration
    • Installing MARIADB

Yum-y Install Mariadb-server

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7F/56/wKiom1caHbqTVF1AAABM8zsWtNg342.jpg "title=" E5670df0-4e12-41d6-8144-be747d4571c7.jpg "alt=" Wkiom1cahbqtvf1aaabm8zswtng342.jpg "/>

    • Start MARIADB

Systemctl Start Mariadb.service

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/55/wKioL1caIRHgiXKkAAAUCYGMHts362.png "title=" Image 7.png "alt=" Wkiol1cairhgixkkaaaucygmhts362.png "/>

    • Initializing database security Settings

Mysql_secure_installation

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/55/wKioL1caImOABrGqAAE7qWsVw64891.jpg "title=" 37d81403-2a91-42ea-800d-46b914032038.jpg "alt=" Wkiol1caimoabrgqaae7qwsvw64891.jpg "/>

    • Configure MARIADB

GRANT all on wpdb.* to [e-mail protected] ' 172.18.%.% ' identified by ' wppass '; FLUSH privileges; CREATE DATABASE Wpdb;use wpdb; SHOW TABLES;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/55/wKioL1caJdbQVoWJAABnvzw8oG0622.png "title=" 74d5c8cc-e84e-493e-9368-bd6e23fd01ec.png "alt=" Wkiol1cajdbqvowjaabnvzw8og0622.png "/>

Host 1 configuration
    • Test Connection Mariadb

Yum-y Install Mariadbmysql-uwpuser-h172.18.77.205-pwppass

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/58/wKiom1caM6bR3vD3AAAfKRdjRY4906.png "title=" Image 8.png "alt=" Wkiom1cam6br3vd3aaafkrdjry4906.png "/>

    • Installing http+php

Yum-y Install httpd php php-mysql
    • Configure HTTPD

vim/etc/httpd/conf/httpd.conf comment #documentroot "/var/www/html" ServerName www.mage.commv/etc/httpd/conf.d/ Welcome.conf{,.bak} Note: due to [[email protected] conf.d]# vim/etc/httpd/conf.d/php.conf comes with AddType text/html. Phpdirectoryindex index.php can parse the PHP type of home page and mime, so there is no need to manually add, but compile and install PHP, remember to manually add php.conf files to the/etc/httpd/conf.d/directory

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/56/wKioL1caQv3xIL9jAAAEja14wzU375.png "title=" 1.png " alt= "Wkiol1caqv3xil9jaaaeja14wzu375.png"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/56/wKioL1caOwmgFAmHAAAEqIIcxoE409.png "title=" 1.png " alt= "Wkiol1caowmgfamhaaaeqiicxoe409.png"/>

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

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/60/wKioL1cciDTA92w8AAAG04_-USQ235.png "title=" 1.png " alt= "Wkiol1ccidta92w8aaag04_-usq235.png"/>

    • 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://s2.51cto.com/wyfs02/M00/7F/56/wKioL1caQDTTYz5fAAA-0qACVDc211.png "title=" 1.png " alt= "Wkiol1caqdttyz5faaa-0qacvdc211.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/wp
mkdir:created directory '/webcom/b.net '
mkdir:created directory '/webcom/b.net/wp '
    • Configuring a 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 '


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

[[email protected] ~]# yum install-y php-xcache[[email protected] ~]# vim/etc/php.d/xcache.inixcache "Open Xcache.cacher Off

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/60/wKioL1cci76QCq7-AAES5fxRWZE440.png "title=" 1.png " alt= "Wkiol1cci76qcq7-aaes5fxrwze440.png"/>


can be changed after installing XCache under the AB command pressure test

[Email protected] ~]# systemctl restart Httpd[[email protected] ~]# ab-n 1000-c Mail protected] ~]# ab-n 1000-c https://www.b.net/wp-config.php

Note that the parameter requests per second (the time required for each request), the speed after enabling XCache should not be enabled for xcache of multiple times.

Configuring HTTPD to support HTTPS
    • (1) Apply for a digital certificate for the server;
      Testing: Issuing a certificate through a privately built CA

      • (a) creating a private CA

      • (b) Create a certificate signing request on the server

      • (c) CA Visa

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

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7F/62/wKiom1ccmreA4mxKAAAN7hYzzjE223.png "title=" 1.png " alt= "Wkiom1ccmrea4mxkaaan7hyzzje223.png"/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7F/60/wKioL1ccm5-BeH7jAAFWZd0LhAw516.jpg "title=" 1.jpg " alt= "Wkiol1ccm5-beh7jaafwzd0lhaw516.jpg"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/62/wKiom1ccmvyBI50-AAA78m0SH-k514.png "title=" 2.png " alt= "Wkiom1ccmvybi50-aaa78m0sh-k514.png"/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7F/60/wKioL1ccnB7RGZQpAACmgzL6kOA185.png "title=" 3.png " alt= "Wkiol1ccnb7rgzqpaacmgzl6koa185.png"/>


    • (2) Configure HTTPD to support the use of SSL, and the use of certificates;

# yum-y Install Mod_ssl

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/60/wKioL1ccnFaAWrb6AACAOfWYGMU188.png "title=" 4.png " alt= "Wkiol1ccnfaawrb6aacaofwygmu188.png"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/62/wKiom1ccm7HwbHRXAACXXmGkPhA178.png "title=" 5.png " alt= "Wkiom1ccm7hwbhrxaacxxmgkpha178.png"/>

    • (3) test-based HTTPS (only with OpenSSL) access to the appropriate host;

# OpenSSL s_client [-connect Host:port] (indicates hostname and port) [-cert filename] (indicates certificate) [-capath directory] (indicates the directory where the CA certificate resides) [-cafile FileName] (indicates CA certificate file) "used to authenticate requests made by client"

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7F/62/wKiom1ccnFOz-ieaAAGBysxbZ74991.jpg "title=" 11.jpg "alt=" Wkiom1ccnfoz-ieaaagbysxbz74991.jpg "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/60/wKioL1ccngPQEPxNAABZUZfC86c134.png "title=" 12.png "alt=" Wkiol1ccngpqepxnaabzuzfc86c134.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/62/wKiom1ccnVrRRnLvAABjiRMi4ww003.png "title=" Image 20.png "alt=" Wkiom1ccnvrrrnlvaabjirmi4ww003.png "/>


At this point, the experiment is complete!



This article is from "Wang Qiang's blog" blog, please be sure to keep this source http://wqiang.blog.51cto.com/6074114/1767278

LAMP (1)--centos-7 two host 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.