WordPress 开源博客搭建

本文详细介绍了如何在服务器上部署WordPress的过程,包括创建MySQL数据库、配置nginx、下载及安装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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值