wordpress 博客环境安装

it2026-04-12  7

WordPress是使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。也可以把 WordPress当作一个内容管理系统(CMS)来使用。

1.数据库环境准备

 mysql> create database wordpress;

Query OK, 1 row affected (0.01 sec)

mysql> grant all on wordpress.* to wordpress@'localhost' identified by '123456';Query OK, 0 rows affected (0.00 sec)

mysql> grant all on wordpress.* to wordpress@'192.168.80.%' identified by '123456';   #如果PHP和mysql不在同一网段,需指定可访问的网段Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)

2.下载安装[root@fox php-7.0.14]# cd /root/toosl-bash: cd: /root/toosl: No such file or directory[root@fox php-7.0.14]# cd /root/tools[root@fox tools]# wget https://cn.wordpress.org/wordpress-4.5.1-zh_CN.tar.gz--2019-06-09 01:15:52-- https://cn.wordpress.org/wordpress-4.5.1-zh_CN.tar.gzResolving cn.wordpress.org... 198.143.164.252Connecting to cn.wordpress.org|198.143.164.252|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 8181644 (7.8M) [application/octet-stream]Saving to: “wordpress-4.5.1-zh_CN.tar.gz”

100%[===========================================================>] 8,181,644 268K/s in 31s

2019-06-09 01:16:24 (261 KB/s) - “wordpress-4.5.1-zh_CN.tar.gz” saved [8181644/8181644]

[root@fox tools]# tar xf wordpress-4.5.1-zh_CN.tar.gz

#web目录可以通过查看nginx配置文件发现  , /etc/nginx/conf.d/*.conf  ,这是我的配置文件路径,文件复制过去[root@fox tools]# cp -a wordpress/* /usr/share/nginx/html/   

 

3.浏览器打开 192.168.80.131/index.php ,出现如下界面

 出现如下提示,执行了 [root@fox nginx]# chown -R nginx.nginx ./  还是不能写入,只好手工帮创建了如下文件,然后继续

解决问题的方法很多种,目测只需要手工创建就能成功,因此不再折腾目录权限问题

 安装成功

 

然后,记住删除掉根目录的 index.html,在配置文件中增加 index.php ,浏览器打开IP地址,输入用户名密码登录系统

这里如果不删index.html,系统一直展示nginx的欢迎页面

 

 

转载于:https://www.cnblogs.com/micfox/p/10992681.html

相关资源:WordPress博客服务器环境配置
最新回复(0)