LAMP-based environment to build and modify Wordpress blog theme

Project Introduction

Today, a record built wordpres blog, and successfully modify the default wordpress theme in which there are a few pit to note the following, therefore blog record.

Preparing the environment

Centos 7 a server

# 暂时将 iptables 关闭、SElinux 修改为警告模式
[root@fp-22 ~]# systemctl stop firewalld.service
[root@fp-22 ~]# setenforce 0

# 检查 ynm 源
[root@fp-22 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
repo id     repo name     status
!base/7/x86_64            CentOS-7 - Base                 10,097
!extras/7/x86_64          CentOS-7 - Extras               323
!updates/7/x86_64         CentOS-7 - Updates              1,446
repolist: 11,866

A software package (available for download):

LAMP environment to build

LAMP environment to build, install it using yum

[root@fp-22 ~]# yum -y install httpd php php-mysql mariadb mariadb-server
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.cqu.edu.cn
……
Dependency Installed:
  httpd-tools.x86_64 0:2.4.6-90.el7.centos      
  libzip.x86_64 0:0.10.1-8.el7                            
……
Complete!

Adding php page test document

[root@fp-22 ~]# cd /var/www/html/
[root@fp-22 html]# vim info.php
<?php
phpinfo();
?>

Start apche, viewed through the process and the success of the port

[root@fp-22 html]# systemctl start httpd
[root@fp-22 html]# ps -ef |grep httpd
root       2015      1  0 21:55 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2017   2015  0 21:55 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
……
apache     2027   2015  0 21:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
root       2030   1802  0 21:59 pts/0    00:00:00 grep --color=auto httpd
[root@fp-22 html]# ss -lntp |grep httpd
LISTEN     0      128       [::]:80                    [::]:*                   users:(("httpd",pid=2027,fd=4),("httpd",pid=2026,fd=4),("httpd",pid=2025,fd=4),("httpd",pid=2024,fd=4),("httpd",pid=2023,fd=4),("httpd",pid=2022,fd=4),("httpd",pid=2020,fd=4),("httpd",pid=2019,fd=4),("httpd",pid=2018,fd=4),("httpd",pid=2017,fd=4),("httpd",pid=2015,fd=4))

Access php test page
Here Insert Picture Description

So far, LAMP set up is completed.

Install wordpress blog

After you upload the installation package, you can see, *. Zip format, unzip command to extract available

[root@fp-22 html]# ll
total 9628
-rw-r--r--. 1 root root      20 Feb 25 21:54 info.php
drwxr-xr-x. 5 root root    4096 Feb  8  2018 wordpress
-rw-r--r--. 1 root root 9848003 Jul 13  2019 wordpress-4.9.4-zh_CN.zip

In this case, go directly to visit, there will be a problem, suggesting that you need to modify a configuration file
[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-iw4Ze0Gw-1582599516788) (E: \ knowledge summary \ assets \ build wordpress_2.png)]

If you do not want the configuration file may be authorized directly in the database, you can

[root@fp-22 ~]# systemctl start mariadb
[root@fp-22 ~]# mysql
……
# 创建中文数据库 wordpress
MariaDB [(none)]> create database wordpress charset utf8;
Query OK, 1 row affected (0.00 sec)
# 授予 tom 用户对于 wordpress 库的所有权限 
MariaDB [(none)]> grant all on wordpress.* to 'tom'@'localhost' identified by '123';
Query OK, 0 rows affected (0.00 sec)
# 刷新权限
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Again to visit, click "Start Now!"[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-YbrfuZBk-1582599516789) (E: \ knowledge summary \ assets \ build wordpress_3.png)]

Click the image input, click "Submit", will enter the next page[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-mgCDmJSC-1582599516791) (E: \ knowledge summary \ assets \ 1582597060812.png)]

It appeared the first pit, can not write to a file, you can modify the owner is a group

# 将属主和属组都修改为 apache
[root@fp-22 ~]# cd /var/www/html/
[root@fp-22 html]# chown -R apache:apache wordpress

Visit the page again, you can refresh
[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-3Y6PzxRZ-1582599516792) (E: \ knowledge summary \ assets \ build wordpress_5.png)]

Click "Install Now", fill in personal information[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-nPAr8f4i-1582599516793) (E: \ knowledge summary \ assets \ build wordpress_6.png)]

Click "Install Wordpress", that is, the installation is successful
[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-dVwGSMG6-1582599516795) (E: \ knowledge summary \ assets \ build wordpress_7.png)]

Click on the "Login" to enter the login page
[Picture dump outside the chain fails, the source station may have a security chain mechanism, it is recommended to save the pictures uploaded directly down (img-0dfgiqW4-1582599516796) (E: \ knowledge summary \ assets \ build wordpress_9.png)]

Click on "Login" and enter Admin
Here Insert Picture Description

Re-open a window to enter the home, as follows[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-T5ABz236-1582599516798)(E:\知识点总结\assets\搭建 wordpress_10.png)]

Modify wordpress theme

Management into the background, click on "Appearance -> Add"
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-607uEusa-1582599516799)(E:\知识点总结\assets\搭建 wordpress_12.png)]

Here we can choose a test
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LR2w2sPA-1582599516800)(E:\知识点总结\assets\搭建 wordpress_13.png)]

Click "Start" to re-open a window, visit the home page, the theme has been changed
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lOY7lzTx-1582599516801)(E:\知识点总结\assets\搭建 wordpress_14.png)]

Here there is a pit, if you do not follow my step by step the above steps, then there will be a problem
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZLml11fx-1582599516802)(E:\知识点总结\assets\搭建 wordpress_15.png)]

After clicking "Install", there was no being installed, but appeared in the following figure
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cpyfEIdw-1582599516803)(E:\知识点总结\assets\搭建 wordpress_16.png)]

In this case, the above-mentioned package (downloadable) into the site directory to unzip

[root@fp-22 html]# ll
total 22744
-rw-r--r--. 1 root root       20 Feb 25 21:54 info.php
-rw-r--r--. 1 root root 13427353 Feb 25 09:32 latest-zh_CN.zip
drwxr-xr-x. 5 root root     4096 Feb 25 22:35 wordpress
-rw-r--r--. 1 root root  9848003 Jul 13  2019 wordpress-4.9.4-zh_CN.zip
[root@fp-22 html]# unzip latest-zh_CN.zip
……

After the extraction is completed, refresh the page directly, click "Install" again to

to sum up

Only inject ideas blog is a good blog

Published 34 original articles · won praise 156 · views 20000 +

Guess you like

Origin blog.csdn.net/xtlhxl/article/details/104492572