Configure a third host.
Configure the second host.
#启动php-FPM Service Process
[[email protected] ~]# systemctl start php-fpm[[email protected] ~]# SS-TNL | grep 9000LISTEN 0 192.168.10.102:9000 *:*
#安装php-xcache Accelerator
[Email protected] ~]# yum-y install Php-xcache
#测试没有问题之后, you can now start deploying WordPress and phpMyAdmin programs on the second host.
#首先搞定WordPress
#从官网下载WordPress压缩包
[Email protected] ~]# wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.zip
#下载后解压, and move to the resource map directory path
[Email protected] ~]# unzip Wordpress-4.7.4-zh_cn.zip[[email protected] ~]# mv wordpress/apps/vhosts/a.com
#cd进该目录, and copy the sample configuration file wp-config-sample.php to wp-config.php
[[email protected] ~]# Cd/apps/vhosts/a.com/wordpress/[[email protected] wordpress]# CP wp-config-sample.php wp-config.php
#修改配置文件wp-config.php, the database information that needs to be modified here comes from the database name, user name, and password that you just created on the third host.
[[email protected] wordpress]# VIM wp-config.php//* * MySQL Settings-specific information from the host you are using * *///** the name of the WordPress database */define (' db_name ', ' wpdb '); # Modify the database name, use the database you just created on the third host/** MySQL database username */define (' db_user ', ' wpuser '); # Modify user name/** MySQL database password */define (' Db_password ', ' wppass '); # Change Password/** mysql host */define (' Db_host ', ' 192.168.10.103 '); # The MySQL host here points to the third host
#至此WordPress就配置完成了, you need to overload the PHP-FPM configuration file
[Email protected] ~]# Systemctl Reload Php-fpm.service
#测试WordPress
#使用浏览器输入URL为http://www.a.com/wordpress
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/86/wKioL1kvcQ6TFLgaAABGIrIAXCA322.png "title=" 1.PNG "alt=" Wkiol1kvcq6tflgaaabgiriaxca322.png "/>
#但是输入http://www.a.com/wordpress is able to access, has ruled out the impact of DirectoryIndex, So how to enable users to access the virtual host www.a.com WordPress directory when automatically return to index.php it?
#问题解决思路: It is possible to create/apps/vhosts/a.com/wordpress on the first host, although the dynamic resources under WordPress are stored on the second PHP-FPM host, while the first httpd host is used to store static resources , but it may still be necessary to have wordpress this empty directory on the first host.
[Email protected] ~]# mkdir/apps/vhosts/a.com/wordpress
#再使用浏览器打开, the URL entered is still http://www.a.com/wordpress
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/97/86/wKioL1kvcr-RWBlHAAC8lvorvNw928.png "title=" 1212. PNG "alt=" Wkiol1kvcr-rwblhaac8lvorvnw928.png "/>
#可以发现, the browser will be redirected to this page, fill in the basic blog personal information, fill out and click Install wordpress
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/97/85/wKiom1kvc1_BqgiVAAAck-i8mgs671.png "title=" 2.PNG "alt=" Wkiom1kvc1_bqgivaaack-i8mgs671.png "/>
#安装后点击登录
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/97/85/wKiom1kvc4mRnNKBAAAqHJZVfqc048.png "title=" 3.PNG "alt=" Wkiom1kvc4mrnnkbaaaqhjzvfqc048.png "/>
#但是点击登录后出现如下页面
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/86/wKioL1kvc7aSRu0TAABKNp59UBE612.png "title=" 4.PNG "alt=" Wkiol1kvc7asru0taabknp59ube612.png "/>
#和刚才一样的解决思路, create the Wp-admin directory under the WordPress directory in the www.a.com site directory on the virtual host on the first host
[Email protected] ~]# mkdir/apps/vhosts/a.com/wordpress/wp-admin
#再次登录wordpress
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/85/wKiom1kvdGbiO4u0AAGfx7GMmiE368.png "style=" float : none; "title=" 5.PNG "alt=" Wkiom1kvdgbio4u0aagfx7gmmie368.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/97/85/wKiom1kvdHPhO37oABhi40uT7SE864.png "style=" float : none; "title=" blog. PNG "alt=" Wkiom1kvdhpho37oabhi40ut7se864.png "/>
#至此Wordpress安装并测试成功, then take care of the 2nd virtual host on the first console phpMyAdmin
#在第二台主机上下载phpMyAdmin压缩包
[Email protected] ~]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip
#解压后并移至虚拟主机www. b.NET under the Site Directory
[Email protected] ~]# unzip Phpmyadmin-4.0.10.20-all-languages.zip[[email protected] ~]# MV Phpmyadmin-4.0.10.20-all-languages/apps/vhosts/b.net[[email protected] ~]# Cd/apps/vhosts/b.net[[email protected] b.net]# LN-SV phpmyadmin-4.0.10.20-all-languages PMA # Create a link directory PMA ' PMA ', ' phpmyadmin-4.0.10.20-all-languages '
#cd进链接目录pma, copy the sample configuration file config.sample.inc.php to config.inc.php and modify the
[[Email protected] b.net]# CD Pma/[[email protected] pma]# CP config.sample.inc.php Config.inc.php[[email protected] PMA] # vim config.inc.php# mainly modifies these two configurations $cfg[' blowfish_secret '] = ' ohtcfa/tpaw47b+cf1be '; /* Must FILL in the this for COOKIE auth! */# above two single quotes in the middle plus a random code for communication encryption, random code can be generated by OpenSSL rand-base64 15 $cfg[' Servers ' [$i] [' host '] = ' 192.168.10.103 '; # This point points to the address of the third host (that is, the database host)
#现在第2台虚拟主机的配置基本完成, overloading the PHP-FPM service process
[Email protected] ~]# Systemctl Reload Php-fpm.service
#在第三台主机上授权用户
[[email protected] ~]# mysqlmariadb [(none)]> GRANT all on * * to [e-mail protected] ' 192.168.%.% ' identified by ' Pmapass ‘; MariaDB [(None)]> FLUSH privileges;
#现在测试phpMyAdmin
#打开浏览器, enter the URL as HTTP://WWW.B.NET/PMA, shown below
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/97/87/wKiom1kvfF3iOTKlAABf2TP2ZNE707.png "title=" 6.PNG "alt=" Wkiom1kvff3iotklaabf2tp2zne707.png "/>
#解决思路: The same exclusion is affected by the DirectoryIndex, although dynamic resources should be stored on the second host, but the user access to the directory name on the second host in the first host's virtual host Site Directory also needs to exist
[Email protected] ~]# MKDIR/APPS/VHOSTS/B.NET/PMA
#再次访问http://WWW.B.NET/PMA, shown below
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/88/wKioL1kvftCgqs6YAADb9NqqZho631.png "title=" 7.PNG "alt=" Wkiol1kvftcgqs6yaadb9nqqzho631.png "/> #重新生成随机码并修改到配置文件config. inc.php, re-access, fill in the database user name and password you just authorized on the third host to log in
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/97/87/wKiom1kvgCXTqnRZAABNPGVhzuE570.png "title=" 8.PNG "alt=" Wkiom1kvgcxtqnrzaabnpgvhzue570.png "/>
can be used normally.
This article is from the "tab" blog, so be sure to keep this source http://xuweitao.blog.51cto.com/11761672/1931266
The distributed implementation of lamp--install WordPress, phpMyAdmin