您的位置:首页 > 其它

实战部署wordpress开源博客

2020-07-18 22:34 411 查看

首先确认LNMP环境是否可用

netstat -tlnup |egrep "80|3306|9000"
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      28112/php-fpm: mast
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      28256/nginx: master
tcp6       0      0 :::3306                 :::*                    LISTEN      21510/mysqld
tcp6       0      0 :::80                   :::*                    LISTEN      28256/nginx: master

下载开源博客源码

cd /app/pack
wget https://wordpress.org/latest.tar.gz
tar xf wordpress-5.4.2.tar.gz -C /app/service
cd /app/service/wordpress
ls  /app/service/wordpress
index.php    wp-activate.php     wp-comments-post.php  wp-cron.php        wp-load.php   wp-settings.php   xmlrpc.php
license.txt  wp-admin            wp-config-sample.php  wp-includes        wp-login.php  wp-signup.php
readme.html  wp-blog-header.php  wp-content            wp-links-opml.php  wp-mail.php   wp-trackback.php

开始部署该项目

将源码内的东西移动到/test 目录下
cp -r  * /test/

修改权限

test目录授权给,nginx用户(编译php时的用户)
chown -R nginx.nginx /test
ls -ld /test/
drwxr-xr-x 5 nginx nginx 4096 Jun 20 10:55 /test/

修改 nginx

vi /app/service/nginx/conf/nginx.conf
server {
listen ip:80;
server_name 域名;
root html;
index index.php index.html index.htm;
location ~ \.php$ {
root html;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
include fastcgi.conf;
}
}


编辑数据库

进入数据库 创建一个用户和库
create database wordpress;
grant all privileges on wordpress.* to "wordpress"@"%" identified by "123qwe";
flush privileges;








完成后随便写一篇博客 ,插入图片

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: