博客站点部署
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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义