WordPress 开源博客搭建

一、前提,在服务器上已经部署完成nginx + mysql + php 的环境,且通过web浏览器能访问到php页面。php测试可以正常访问到数据库

二、部署整备:

  1、在MySQL中创建一个库

[root@localhost html]# mysql -uroot -p     //连接数据库
Enter password: 
MariaDB [(none)]> show databases;        //查看当前数据库中有那些库
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
MariaDB [(none)]> create database wordpress;  //创建一个wordpress库
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| wordpress          |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> select user();             //查看当前管理库的用户
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)
MariaDB [(none)]> grant all on *.* to wordpress@'localhost' identified by '123456';       //创建一个wordpress用户并做一个授权
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

  2、调整nginx的配置内容并重启nginx  /application/nginx/sbin/nginx -s reload

        location / {
            root   html;
            index  index.php index.html index.htm;
        }

  3、下载配置wordpress

[root@localhost html] wget https://cn.wordpress.org/wordpress-4.5.1-zh_CN.tar.gz       //我这里的下载目镜是/home/pandj/tools
[root@localhost html] cp -a wordpress/* /application/nginx/html/      //将workpress的配置文件放入nginx的/html目录下

  4、浏览器访问ip.进去wordpress配置页面

  

原文地址:https://www.cnblogs.com/pandj/p/9414426.html