CentOS7下使用ghost-cli部署ghost博客平臺

ghost是基于node.js的新一代博客平臺——相比日漸臃腫、無所不能的WordPress,Ghost更專注于博客,在官網(wǎng)上打出“只做博客平臺”的口號,因此相對WordPress會更加簡潔易用。

1.基礎(chǔ)配置

1.1安裝node.js及nginx

首先是在VPS上安裝node.js v6 LTS:
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
然后執(zhí)行
sudo yum -y install nodejs
以及
sudo yum install gcc-c++ make

接下來安裝nginx:
yum install -y nginx

2.安裝ghost-cli

ghost-cli是1.0版本之后出現(xiàn)的新工具。
官網(wǎng)介紹:"With Ghost 1.0.0, we have introduced Ghost CLI - a fully loaded tool to help you get Ghost installed, setup & configured and to make it super easy to keep your Ghost install up to date."

簡單來說就是它能夠幫助我們更加方便地安裝,啟動,升級和管理我們的ghost-blog.

安裝ghost-cli:
sudo npm i -g ghost-cli

不知道是不是因為我的VPS在國內(nèi),裝了好久= =..墻越來越厲害了...
早知道應(yīng)該用cnpm的.

3.ghost安裝

以文件夾blog為例,我們可以先創(chuàng)建一個叫做blog的文件夾安放我們的博客文件:
mkdir blog
cd blog

然后就可以使用ghost-li來安裝ghost了
ghost install [version]
version可為1.0.2等等,如果要安裝最新版只需ghost install即可.

warning:
此上安裝方法數(shù)據(jù)庫默認(rèn)為mysql,如果使用sqlite3可以使用一下語句:
ghost install --db sqlite3 --dbpath ./content/data/ghost.db

接下來會有幾行warning:
System checks failed with message: 'Linux version is not Ubuntu 16'
Some features of ghost-cli may not work without additional configuration
...

我選擇了無視它繼續(xù)往前走
后面就會是讓你輸入blogUrl
是否配置nginx SSL Systemd
按照自己意愿做出選擇就好.

4.使用

在nginx.conf做好配置后就能夠重啟nginx了,如果域名解析正確就能夠使用了

進入 http://你的域名/ghost
該網(wǎng)址為ghost的管理后臺

ghost官方文檔:https://docs.ghost.org/v1.0.0/docs/introduction

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容