Construction of LNMP + WordPress

Basic preparation;

The real case requires the use of a cloud host, using actual cases 5.2 OpenStack cloud platform to create a host
as a node LNMP this experiment, the following experiment.

Case Implementation:
on behalf of LNMP is Nginx + MySQL + PHP web server architecture that Linux system.
Linux is a Unix-like computer operating system collectively, is the most popular free operating system. Representatives versions Debian, CentOS, Ubuntu, Fedora, Gentoo and so on.
Nginx is a high-performance HTTP and reverse proxy server is a IMAP / POP3 / SMTP proxy server.
MySQL is a small relational database management systems.
PHP is an HTML document embedded scripting language which is performed on the server side.
The four software are free and open source software, combined together into a free, efficient, extensible web service system.

 

1. Install LNMP environment

First configure the network, modify the host name:

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

[root@localhost ~]# hostnamectl set-hostname lnmp

Selinux modify configuration files, turn off the firewall, and set the boot does not start:

[root@lnmp ~]#vi /etc/selinux/config

The SELINUX = enforcing amended as permissive

[root@lnmp ~]#setenforce 0

View Status: getenforce

[root@lnmp ~]#systemctl  stop  firewalld

[root@lnmp ~]#systemctl  disable  firewalld

yum comes with original source using yum:

[root@lnmp ~]#yum clean all

[root@lnmp ~]#yum repolist

We will provide lnmp1.6-full.tar.gz package uploaded to the virtual machine / root directory, and extract the following command:

[root@lnmp ~]# tar -zxvf lnmp1.6-full.tar.gz

After the decompression is complete, enter lnmp1.6-full directory, execute the installation script (before executing the script, you need to configure the DNS )

Command is as follows:

[root@lnmp ~]# cd lnmp1.6-full

[root@lnmp lnmp1.6-full]# ./install.sh

Depending on the virtual machine configuration, installation time will be different, after the execution of the script is finished, there will be tips for success, such as

FIG.  FIG. (When prompted, select the default software installation version, set the database password, the installation is successful press

Ctrl + C to exit)

Using a browser, enter the virtual machine IP , see the interface, as shown in Fig.

2. deploy WordPress application

In the deployment of WordPress before, need to do some basic configuration, first database, you need to log database,

Create a WordPress database and give remote permissions, the command is as follows:

[root@lnmp ~]# mysql -uroot -p000000

mysql> create database wordpress;

mysql> grant all privileges on *.* to root@localhost identified by '000000' with grant option;

mysql> grant all privileges on *.* to root@"%" identified by '000000' with grant option;

mysql> Ctrl-C -- exit!

 

We will provide wordpress-4.7.3-zh_CN.zip archive uploaded to a virtual machine / root directory and extract the following command:

[root@lnmp ~]# unzip wordpress-4.7.3-zh_CN.zip

Enter / home / wwwroot / default directory, index.html delete command is as follows :( this directory is Nginx 's

Project directory, delete the default page that is present anyway)

[root@lnmp default]# rm -rf index.html

Back to the / root / wordpress directory, all files in the directory, copied to / home / wwwroot / default directory

Under and give 777 permissions, the command is as follows:

[root@lnmp wordpress]# cp -rvf * /home/wwwroot/default

[root@lnmp wordpress]# cd /home/wwwroot/default/

[root@lnmp default]# chmod 777 *

At / home / wwwroot / default / directory, you can see a wp-config-sample.php configuration file, the text

Piece is WordPress application provides a template configuration file, copy the template and renamed the WP-config.php ,

Then edit the file, the command is as follows:

[root@lnmp default]# cp wp-config-sample.php wp-config.php

[root@lnmp default]# vi wp-config.php

// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress 数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL 数据库用户名 */
define('DB_USER', 'root');
/** MySQL 数据库密码 */
define('DB_PASSWORD', '000000');
/** MySQL 主机 */
define('DB_HOST', '127.0.0.1');
/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');
/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

After modification, save and exit, enter the address in the browser 192.168.20.4 , refresh the page, enter WordPress

Installation interface, fill in the necessary information, and then click the lower left corner "Install WordPress " button, as shown.

Fill use when installing account and password information, and then click the lower right corner of the "Login" button to log in WordPress ,

As shown in FIG.

After logging into the WordPress backend dashboard interface applications:

 

Click the top left corner " MyBlog " icon to enter the blog home page, you can post here, deeds and other records:

At this point, WordPress application deployed

 

 

 

Published 18 original articles · won praise 0 · Views 460

Guess you like

Origin blog.csdn.net/weixin_45678149/article/details/104578553