wordpress快速部署

1. 操作系统更新

dnf update -y

2. 安装apache+开机启动

dnf install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

3. 安装MariaDB+开机启动+安全配置

dnf install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation

4. 安装PHP及扩展

dnf install php php-mysqlnd php-xml php-gd php-json php-mbstring -y
重启apache支持PHP解析
systemctl restart httpd

5. 创建wordpress数据库+用户

sudo mysql -u root -p
>进入数据库开始操作 
CREATE DATABASE your_dbname;
CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON your_dbname.* TO 'your_username'@'localhost';
FLUSH PRIVILEGES;
EXIT;

6. 下载最新版的wordpress

cd /var/www/html/
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz
sudo rm latest.tar.gz
sudo mv wordpress/* ./
sudo chown -R apache:apache /var/www/html/
sudo find /var/www/html/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/ -type f -exec chmod 640 {} \;

7. 配置防火墙和安全组开通访问

8. 网页配置wordpress