CentOS7 运维 - 搭建WordPress论坛
更新时间:2021年1月31日
使用版本:5.6
官方下载地址:https://cn.wordpress.org/download/
准备环境
- 服务器操作系统:CentOS7
- 部署服务器:Apache HTTP
- 数据库:MySQL
- 框架:WordPress
一、安装Apache HTTP
sudo yum install httpd
安装完毕后,启动服务
systemctl start httpd.service #启动服务
systemctl status httpd.service #查看服务状态
关闭防火墙,使用其他设备测试
systemctl stop firewalld.service
二、安装MySQL
在线下载MySQL的安装包
wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
开始安装MySQL
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
安装MySQL服务
过程可能会非常漫长,所以这里推荐使用国内源
cd /etc/yum.repos.d/
yum -y install mysql-server
启动MySQL
systemctl start mysqld
修改MySQL密码
查看临时密码
grep 'temporary password' /var/log/mysqld.log
使用临时密码登录MySQL
mysql -u root -p
修改MySQL密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '密码';
在MySQL中新建数据库
创建一个叫wordpress的数据库
create database wordpress;
三、安装PHP
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w
yum install php70w-fpm php70w-mysql php70w-xml php70w-mbstring php70w-openssl php70w-gd
# 安装php70的扩展[必须要]
四、安装WordPress
如果下载速度过慢可尝试站内下载
##此处为官方源
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
使用 tar 解压文件
tar -zxvf latest-zh_CN.tar.gz
将文件复制到 /var/www/html 下
cp -rf wordpress/* /var/www/html/
在此填入数据库名、数据库用户名以及密码后点击提交
填写站点信息
安装完成
登录你的站点
如有疑问或哪个步骤出现问题,请在下方留言