這是一個簡單的架構主要是爲了說明問題:如何搭建私人博客服務
採用的項目是wordpress官網下載的項目
項目版本:https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz
系統是CentOS7-LNMP模式
基礎環境:關閉安全機制
下載 nginxweb服務、mysql數據庫、php語言解析庫、php-mysql連接數據庫工具、php-fpm(使nginx服務解析php語言庫)
#yum install -y nginx mariadb mariadb-server php php-mysql php-fpmphp
安裝《數據庫緩存》減輕了數據庫訪問壓力,提高了用戶體驗
緩存服務軟件memcached 關聯php服務軟件:php-pecl-memcache
#yum -y install –enablerepo=rpmforge memcached php-pecl-memcache
#systemctl start memcached
#systemctl enable memcached
#systemctl reload nginx.servicehtml
安裝《php二進制緩存》避免一樣的代碼重複編譯,提升訪問質量體驗
#yum install -y php-xcache
#systemctl reload nginx.servicemysql
一、nginx部分:設置啓動並開啓自啓動
#systemctl start nginx
#systemctl enable nginx
關於nginx配置文件部分請參考其它章節nginx
二、mysql部分:設置啓動並開啓自啓動
#systemctl # systemctl enable mariadbstart mariadb
#systemctl enable mariadbweb
三、上傳項目到/usr/share/nginx/html 並受權777
上傳就省略了;# chmod 777 /usr/share/nginx/htmlsql
四、給數據設置登陸密碼
#mysqladmin -uroot password '123'數據庫
五、建立項目使用的數據庫
MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)緩存
六、建立一個專用的WordPress blog管理用戶
MariaDB [(none)]> grant all on wordpress.* to wordpress@'localhost' identified by '123';
Query OK, 0 rows affected (0.00 sec)安全
七、測試登陸架構