Installation and application of distributed deployment lamp,phpmyadmin,wordpress

Source: Internet
Author: User
Tags mysql host install wordpress phpmyadmin wordpress database

System Environment: centos7,httpd-2.4,php-5.5,mariadb5.5

192.168.1.20 httpd

192.168.1.30 PHP

192.168.1.40 mariadb


Modifying the client Hosts file

[Email protected] desktop]# vim/etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.1.20 www.pma.c Om www.wp.com

Installing the HTTPD service on 192.168.1.20

[Email protected] yum.repos.d]# Yum-yinstall httpd

Modify MPM Edit Module as Event

[[email protected] yum.repos.d]# cd/etc/httpd/ Conf.modules.d/[[email protected] conf.modules.d]# vim00-mpm.conf 
 # select the mpm module which should beused by uncommenting  exactly# one of the following LoadModule lines: # prefork  mpm: implements a non-threaded, pre-forkingweb server# see:http:// httpd.apache.org/docs/2.4/mod/prefork.html#loadmodulempm_prefork_module modules/mod_mpm_prefork.so #  worker mpm: multi-processing moduleimplementing a hybrid# multi-threaded  multi-process web server# see: http://httpd.apache.org/docs/2.4/mod/worker.html## Loadmodule mpm_worker_modulemodules/mod_mpm_worker.so # event mpm: a variant  of the worker mpmwith the goal of consuming# threads only  for connections with activeprocessing# see: http://httpd.apache.org/docs/2.4/ Mod/event.html#loadmodulempm_event_modUle modules/mod_mpm_event.so 

Edit the WordPress virtual Host configuration file

[Email protected] conf.d]# cd/etc/httpd/conf.d[[email protected] conf.d]# vim wp.conf <virtualhost *:80> Serverna Me www.wp.com documentroot/wordpress/wordpress proxyrequests off DirectoryIndex index.php proxypassmatch ^/(. *.ph P) $fcgi://192.168.1.30:9000/wordpress/wordpress/$1 <directory "/wordpress/wordpress" > Options None All Owoverride None Require All granted </Directory></VirtualHost>

Edit phpMyAdmin Virtual Host configuration file

[Email protected] conf.d]# vim pma.conf<virtualhost *:80> ServerName www.pma.com Documentroot/usr/share/phpmya DMin proxyrequests off DirectoryIndex index.php proxypassmatch ^/(. *.php) $fcgi://192.168.1.30:9000/usr/share/phpmyad   min/$1 <directory "/usr/share/phpmyadmin" > Options none allowoverride none Require all granted </Directory></VirtualHost>

Create the appropriate folder

[Email protected] conf.d]# mkdir-p/usr/share/phpmyadmin

Reload httpd Service

[Email protected] conf.d]# Systemctl reloadhttpd

Installing the Php-fpmphp-mysql on the 192.168.1.30

[email protected] ~]# Yum install-y php-fpmphp-mysql

Modify the PHP-FPM configuration file to change the listening IP address to a native address

[Email protected] ~]# cd/etc/php-fpm.d/[[email protected] php-fpm.d]# vim Www.conflisten = 192.168.1.30:9000 # # #通过网络连接可用的IP及端口listen. allowed_clients = 192.168.1.20 # # #允许那台主机连接至本机

Start php-rpm

[Email protected] php-fpm.d]# Systemctl STATUSPHP-FPM

Installing the MARIADB on the 192.168.1.40

[Email protected] yum.repos.d]# Yum-yinstall mariadb-service mariadb

Create a database wpdb

MariaDB [(None)]> grant all on wpdb.* [e-mail protected] ' 192.168.%.% ' identified by ' pass '; Query OK, 0 rows Affected (0.00 sec) MariaDB [(None)]> CREATE Database wpdb; Query OK, 1 row Affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows Affected (0.00 sec) Ry ok,0 rows Affected (0.00 sec)

Create an account for phpMyAdmin

MariaDB [(None)]> create [email protected] ' 192.168.%.% ' identified by ' mppass '; Query OK, 0 rows Affected (0.00 sec) MariaDB [(none)]> grant all on *. * [email protected] ' 192.168.%.% ' identified by ' m Ppass '; Query OK, 0 rows Affected (0.00 sec) MariaDB [(none)]> flash privileges; Query OK, 0 rows Affected (0.00 sec)

Install WordPress (This is the direct copy of WordPress directly into Linux in Windows)

[Email protected] conf.d]# cd/wordpress/[[email protected] wordpress]# Unzipwordpress-4.5.3-zh_cn.zip[[email Protected] wordpress]# cd/wordpress/wordpress/

Modifying a configuration file

[Email protected] wordpress]# mvwp-config-sample.php wp-config.php[[email protected] wordpress]# vimwp-config.php
* * MySQL Settings-specific information from the host you are using * *///** WordPress database name */define (' db_name ', ' wpdb '); /** MySQL Database user name */define (' Db_user ', ' wpuser '); /** MySQL Database password */define (' Db_password ', ' wppass '); /** MySQL host */define (' Db_host ', ' 192.168.1.40 ');

Validation of www.wp.com after database is configured

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/84/52/wKioL1eM5W6ze7S1AADtw2OFAnQ637.png "title=" 1.png " alt= "Wkiol1em5w6ze7s1aadtw2ofanq637.png"/>

PS: If the display garbled, in the httpd server corresponding to the virtual host DocumentRoot install wordpress, you can.


Installing phpMyAdmin

[Email protected] conf.d]# yum-y installphpmyadmin

Add a server address for MySQL

$cfg [' Servers '] [$i] [' host '] = ' 192.168.1.40 '; MySQL Hostnameor IP Address

Modifying configuration information for phpMyAdmin

[Email protected] phpmyadmin]# cd/etc/phpmyadmin/[[email protected] phpmyadmin]# vimconfig.inc.php

Login Verification

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/52/wKioL1eM5ZzS_lDSAAIEqCppJBM364.png "title=" 2.png " alt= "Wkiol1em5zzs_ldsaaieqcppjbm364.png"/>

PS: If the display garbled, in the httpd server corresponding to the virtual host DocumentRoot installation phpMyAdmin, you can.


Installation and application of distributed deployment lamp,phpmyadmin,wordpress

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.