博客站点部署

部署开源项目wordpress-5.8.1

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

 

posted on   烟嗓  阅读(13)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示