博客站点部署
1.部署nginx
配置文件
vim /etc/nginx/conf.d/wordpress.conf
server {
server_name wordpress.zh.com;
listen 80;
root /web/wordpress;
index index.php index.html;
location ~ \.php$ {
root /web/wordpress;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
2.获取开源项目源码
mv wordpress-5.8.1.tar.gz /web
cd /web
tar xf /web/wordpress-5.8.1.tar.gz
3.安装php
tar xf php72.tar.gz
yum localinstall -y php72/*
4.改php-fpm的程序用户
sed -ri '/^(user|group)/s#apache#nginx#' /etc/php-fpm.d/www.conf
5.修改web目录的归属
chown -R nginx.nginx /web
6.启动或重启php-fpm和nginx
systemctl enable nginx php-fpm
systemctl restart nginx php-fpm
7.安装
yum install -y mariadb-server
8.启动服务
systemctl start mariadb
systemctl enable mariadb
9.录数据库,创建所需的库,用户授权
mysql
> create database wordpress;
> grant all on wordpress.* to wpadm@'localhost' identified by '123';
10.修改域名解析
C:\Windows\System32\drivers\etc -> hosts -> 10.0.0.7 wordpress.zh.com
验证:
wordpress.zh.com
浙公网安备 33010602011771号