Experimental goal: Build LNMP and implement Wordpress,phpmyadmin function, and add HTTPS service for phpMyAdmin
Lab Environment: CENTOS7, installing nginx,php,php-fpm,mariadb,pgp-mysql with Epel source, php-mbstring
Modify the Hosts file to add a record
[Email protected] php-fpm.d]# vim/etc/hosts
172.16.34.2 www.pma.com www.wp.com
Configuration of Nginx
Switch to the Nginx profile directory, add the server content comment in the configuration file, and the default viewing option for index in the HTTP context
[Email protected] phpmyadmin]# Cd/etc/nginx
[Email protected] nginx]# vim nginx.conf
Index index.php index.html index.htm;
Switch to CONF.D directory
[Email protected] nginx]# CD conf.d/
Create a wp.conf configuration file
[[email Protected] conf.d]# vim wp.conf
Server {
listen80;
server_namewww.wp.com;
root/wp/wordpress;
location ~ \.php$ {
fastcgi_pass 172.16.34.2:9000;
fastcgi_index index.php;
fastcgi_param script_filename/wp/ wordpress/$fastcgi _script_name;
include fastcgi_params;
}
}
Create a phpMyAdmin configuration file
[Email protected] conf.d]# vim pma.conf
server {
Listen80;
server_namewww.pma.com;
ROOT/PMA/PMA;
Location ~ \.php$ {
Fastcgi_pass 172.16.34.2:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename/pma/pma/$fastcgi _script_name;
Include Fastcgi_params;
}
}
Configure PHP-FPM to add the current host IP address
[Email protected] ~]# cd/etc/php-fpm.d/
[Email protected] php-fpm.d]# vim www.conf
Listen = 172.16.34.2:9000
Listen.allowed_clients = 172.16.34.2
Configure MARIADB
Create a WordPress database and account password
MariaDB [(None)]> create [email protected] ' 172.16.%.% ' identified by ' wppass ';
Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]> CREATE Database wpdb;
Query OK, 1 row Affected (0.00 sec)
MariaDB [(None)]> grant all on Wpdb.*to [e-mail protected] ' 172.16.%.% ' identified by ' wppass ';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(None)]> flush privileges;
Query OK, 0 rows Affected (0.00 sec)
Create phpMyAdmin with account password
MariaDB [(None)]> create [email protected] ' 172.16.%.% ' identified by ' pmapass ';
Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]> grant all on *.*to [e-mail protected] ' 172.16.%.% ' identified by ' pmapass ';
Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]> flush privileges;
Query OK, 0 rows Affected (0.00 sec)
Install WordPress
Using the WordPress compressed package, will be copied to the server, here using the/wp directory
[Email protected] ~]# mkdir/wp
[Email protected] ~]# cd/wp
[Email protected] wp]# Unzipwordpress-4.5.3-zh_cn.zip
[Email protected] wp]# CD wordpress/
Modify the database address in the 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 * *//
/** Name of WordPress database */
Define (' db_name ', ' wpdb ');
/** MySQL Database user name */
Define (' Db_user ', ' wpuser ');
/** MySQL Database password */
Define (' Db_password ', ' wppass ');
/** MySQL Host */
Define (' Db_host ', ' 172.16.34.2 ');
Verify Login
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/85/28/wKiom1ebHjfjrdV0AAEGH6R4C8Q440.png "title=" 5.png " alt= "Wkiom1ebhjfjrdv0aaegh6r4c8q440.png"/>
Configure phpMyAdmin
Using phpMyAdmin's compressed package, copy to server, use/PMA directory here
[Email protected] ~]# MKDIR/PMA
[Email protected] ~]# CD/PMA
[Email protected] pma]# Unzipphpmyadmin-4.4.14.1-all-languages.zip
Make a soft connection to the Unpacked folder
[Email protected] pma]# ln-sphpmyadmin-4.4.14.1-all-languages PMA
Edit the phpMyAdmin configuration file
[Email protected] pma]# mvconfig.sample.inc.php config.inc.php
[Email protected] pma]# vim config.inc.php
$cfg [' Servers '] [$i] [' host '] = ' 172.16.34.2 ';
Login Verification
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/85/28/wKiom1ebHkbBqy9LAAGpr_CoL3Y931.png "title=" 4.png " alt= "Wkiom1ebhkbbqy9laagpr_col3y931.png"/>
Implement Wopdpress,phpmyadmin Services with LNMP and provide HTTPS services for phpMyAdmin