實戰部署wordpress開源博客

首先確認LNMP環境是否可用php

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

下載開源博客源碼html

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

開始部署該項目mysql

將源碼內的東西移動到/test 目錄下
cp -r  * /test/

修改權限nginx

test目錄受權給,nginx用戶(編譯php時的用戶)
chown -R nginx.nginx /test
ls -ld /test/
drwxr-xr-x 5 nginx nginx 4096 Jun 20 10:55 /test/

修改 nginxsql

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;
}
}

實戰部署wordpress開源博客
編輯數據庫數據庫

進入數據庫 建立一個用戶和庫
create database wordpress;
grant all privileges on wordpress.* to "wordpress"@"%" identified by "123qwe";
flush privileges;

實戰部署wordpress開源博客
實戰部署wordpress開源博客
實戰部署wordpress開源博客
實戰部署wordpress開源博客
實戰部署wordpress開源博客
實戰部署wordpress開源博客
實戰部署wordpress開源博客
完成後隨便寫一篇博客 ,插入圖片app

相關文章
相關標籤/搜索