System platform: CentOS 7 1611
Wordpress
PhpMyAdmin (CentOS 7 does not recommend installing the latest version, otherwise you need to compile the latest PHP-FPM)
Install httpd (192.168.1.200), PHP-FPM (192.168.1.201), mariadb (192.168.1.202) on three hosts respectively,
and provide WordPress, phpMyAdmin application
1. Install and configure the httpd server
1.1 Installing the HTTPD service
[email protected] ~]# Yum install-y httpd
1.2 Edit the httpd configuration file and create the virtual host
[[email protected] ~]# mkdir -pv /www/{wp.com,pma.com}/htdocs[[email protected] ~]# vim /etc/httpd/conf/httpd.confServerName localhost:80#DocumentRoot "/www/wp.com/ Htdcos "<virtualhost 192.168.1.200:80> servername www.wp.com DocumentRoot "/www/wp.com/htdocs/" ProxyRequests off proxypassmatch ^/(. *\.php) $ fcgi://192.168.1.201:9000/www/wp.com/htdocs/$1 <Directory "/www/wp.com/htdocs/" > Options None AllowOverride None require all granted </Directory></VirtualHost><VirtualHost 192.168.1.200:80> ServerName www.pma.com DocumentRoot "/www/pma.com/htdocs/" proxyrequests off proxypassmatch ^/(. *\.php) $ fcgi:// 192.168.1.201:9000/www/pma.com/htdocs/$1 <directory "/ www/pma.com/htdocs/"> Options FollowSymLinks AllowOverride None &nbSp require all granted </directory></ Virtualhost>
2. Install and configure the PHP-FPM service
2.1 Installing PHP-FPM, php-mbstring, Php-mysql services
[Email protected] ~]# yum-y install php-fpm php-mbstring.x86_64 php-mysql
2.2 Modifying the PHP-FPM configuration file
[Email protected] ~]# vim/etc/php-fpm.d/www.conf listen = 0.0.0.0:9000 #表示监听所有端口; listen.allowed_clients = 127.0.0.1 #注 When released, all hosts are allowed access by default
2.3 Create/wordpress and phpMyAdmin Web page files directory and place WordPress and phpMyAdmin files in this folder
[Email protected] ~]# Mkdir-pv/www/{wp.com,pma.com}/htdocs
Note: If you encounter phpMyAdmin login unresponsive, please try the following:
[Email protected] pma]# mkdir/var/lib/php/session-pv[[email protected] pma]# chown-r Apache.apache/var/lib/php/sessi On/[[email protected] pma]# systemctl restart Php-fpm.service
3. Installation and Configuration MARIADB service
3.1 Install MARIADB service (CentOS 7 comes with mariadb service, start up)
[Email protected] ~]# yum-y install Mariadb-server
[Email protected] ~]# systemctl start Mariadb.service
3.2 Creating a database and adding users, granting Permissions
MariaDB [(None)]> CREATE database WP; MariaDB [(None)]> CREATE uesr ' wp ' @ '%.%.%.% ' identified by ' wppasswd '; MariaDB [(None)]> GRANT all on * * to [e-mail protected] ' 192.168.1.% ' identified by ' wppasswd ';
4. Configure WordPress, PhpMyAdmin
4.1 Unzip the downloaded file and create a link for phpMyAdmin
[Email protected] wordpress]# unzip wordpress-4.7.4-zh_cn.zip [[email protected] wordpress]# Unzip phpmyadmin-4.0.10.20-all-languages.zip [[email protected] html]# LN-SV phpmyadmin-4.0.10.20-all-languages PMA
4.2 Modifying wordpress configuration Widgets
[Email protected] html]# CD wordpress/[[email protected] wordpress]# cp wp-config-sample.php wp-config.php [[Email Pro] Tected] wordpress]# vim wp-config.php define (' db_name ', ' WP '); #数据库名称 define (' Db_user ', ' WP '); #用于连接数据库的用户名 define (' Db_password ', ' wppasswd '); #用于连接数据库的密码 define (' Db_host ', ' 192.168.1.202 '); #数据库的路径
4.3 Modifying the phpMyAdmin configuration file
[[email protected] wordpress]# Cd/var/www/html/pma/[[email protected] pma]# CP config.sample.inc.php Config.php[[email Protected] pma]# OpenSSL rand-base64 #生成配置文件中所需的随机数A42B1Noto1YiqQMC3DV7 [[email protected] pma]# vim config.php$ cfg[' blowfish_secret '] = ' a42b1noto1yiqqmc3dv7 '; /* Must FILL in the this for COOKIE auth! */$cfg [' Servers '] [$i] [' host '] = ' 192.168.1.202 ';
4.4 Copying WordPress and phpMyAdmin to the corresponding path on the httpd server
[Email protected] pma]# scp-p 22/var/www/html/pma/* [email protected]:/var/www/html/pma[[email protected] pma]# scp-p 22/var/www/html/wordpress/* [Email protected]:/var/www/html/wordpress
This article is from the "7358072" blog, please be sure to keep this source http://7368072.blog.51cto.com/7358072/1925398
CentOS 7 Yum installs lamp, three on different servers, and installs WordPress and phpMyAdmin for it