Article Directory
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):
- wordpress-4.9.4-zh_CN.zip
- Link Click here to download - latest-zh_CN.zip
- Link Click here to 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
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
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!"
Click the image input, click "Submit", will enter the next page
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
Click "Install Now", fill in personal information
Click "Install Wordpress", that is, the installation is successful
Click on the "Login" to enter the login page
Click on "Login" and enter Admin
Re-open a window to enter the home, as follows
Modify wordpress theme
Management into the background, click on "Appearance -> Add"
Here we can choose a test
Click "Start" to re-open a window, visit the home page, the theme has been changed
Here there is a pit, if you do not follow my step by step the above steps, then there will be a problem
After clicking "Install", there was no being installed, but appeared in the following figure
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