站長資訊網
最全最豐富的資訊網站

CentOS 7.5上安裝Node.js搭建Ghost個人博客

Ghost簡介

Ghost 是基于 Node.js 構建的開源博客平臺,由前 WordPress UI 部門主管 John O’Nolan 和 WordPress 高級工程師(女) Hannah Wolfe 創立。Ghost 具有易用的書寫界面和體驗,博客內容默認采用Markdown 語法書寫。Ghost 的目標是取代臃腫的 WordPress。目的是為了給用戶提供一種更加純粹的內容寫作與發布平臺。

CentOS 7.5上安裝Node.js搭建Ghost個人博客

開始搭建Ghost博客系統

1、本機測試環境

[linuxidc@localhost ~]$ cat /etc/RedHat-release
CentOS Linux release 7.5.1804 (Core)
[linuxidc@localhost ~]$ uname -r
3.10.0-862.el7.x86_64

CentOS 7.5上安裝Node.js搭建Ghost個人博客

2、 安裝Node.js

#更新yum源
[root@mingc ~]# sudo yum update -y

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#安裝軟件組包Development Tools
[linuxidc@localhost ~]$ sudo yum groupinstall -y “Development Tools”

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#安裝NodeSource Node.js 6.x repo
[root@localhost ~]# curl –silent –location https://rpm.nodesource.com/setup_6.x | bash –

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#yum安裝 nodejs
[root@localhost ~]# yum -y install nodejs

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#npm國內鏡像(npm是隨同NodeJS一起安裝的包管理工具)
[root@localhost ~]# npm config set registry https://registry.npm.taobao.org
#安裝cnpm模塊(因為國內網絡的關系,也同時安裝了 cnpm 模塊,后續將使用該命令代替 npm 命令。)
[root@localhost ~]# npm i -g cnpm

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#通過node -v 和npm -v命令查看是否安裝成功。

[root@localhost ~]# node -v
v6.14.4
[root@localhost ~]# npm -v
3.10.10
[root@localhost ~]#

CentOS 7.5上安裝Node.js搭建Ghost個人博客

3.、安裝 Ghost

①安裝 Ghost Client (ghost-cli)

[root@localhost ~]# cnpm i -g ghost-cli
#安裝成功后通過運行 ghost -v,出現版本號即可表示安裝成功。

CentOS 7.5上安裝Node.js搭建Ghost個人博客

[root@localhost ~]# ghost -v
Ghost-CLI version: 1.9.6
[root@localhost ~]#

CentOS 7.5上安裝Node.js搭建Ghost個人博客

②添加 Ghost 運行用戶并創建目錄

[root@localhost ~]# adduser ghost
[root@localhost ~]# mkdir /var/www
[root@localhost ~]# mkdir /var/www/ghost
[root@localhost ~]# chown ghost /var/www/ghost

CentOS 7.5上安裝Node.js搭建Ghost個人博客

③安裝SQLite3 數據庫

#新版本不允許root用戶安裝,需要切換普通用戶進行安裝。

[root@localhost ~]# su – ghost
[ghost@localhost ~]$ cd /var/www/ghost

CentOS 7.5上安裝Node.js搭建Ghost個人博客

[ghost@localhost ghost]$ ghost install local –db=sqlite3
✔ Checking system Node.js version
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v2.3.0
✔ Finishing install process
✔ Configuring Ghost
✔ Setting up instance
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✔ Validating config
✔ Checking memory availability
✔ Starting Ghost

Ghost uses direct mail by default. To set up an alternative email method read our docs at https://ghost.org/mail

——————————————————————————

Ghost was installed successfully! To complete setup of your publication, visit:

    http://localhost:2368/ghost/

CentOS 7.5上安裝Node.js搭建Ghost個人博客

④啟動 ghost
安裝成功后 Ghost 默認就已經啟動的

# 停止host
[ghost@localhost ghost]$ ghost stop
✔ Stopping Ghost

# 啟動ghost
[ghost@localhost ghost]$ ghost start

#重啟ghos
[ghost@localhost ghost]$ ghost restart

安裝成功后默認是運行在http://localhost:2368/
可使用如下方式訪問:
[ghost@localhost ghost]$ curl http://localhost:2368/

CentOS 7.5上安裝Node.js搭建Ghost個人博客

4. 安裝 Nginx和整合nodejs

[ghost@localhost ghost]$ su – root
[root@localhost ~]# yum install -y nginx
#啟動 Nginx
[root@localhost ~]# systemctl start nginx.service
#查看nginx是否運行
[root@localhost ~]# ps -ef|grep nginx

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#查看是否啟動成功 http://你的ip

CentOS 7.5上安裝Node.js搭建Ghost個人博客

#設置開機自啟動
[root@localhost ~]# systemctl enable nginx.service
#整合nodejs
[root@localhost ~]# cp /etc/nginx/nginx.conf  /etc/nginx/nginx.conf.ori
[root@mingc nginx]# vi /etc/nginx/nginx.conf +47
 server {
 ···
        location / {
        proxy_pass http://127.0.0.1:2368;
        proxy_redirect default;
        root  /usr/share/nginx/html;
        index  index.html index.htm;
        }
                ···
[root@localhost ~]# nginx -s reload           

5. 訪問搭建的ghost博客

前臺頁面:http://你的ip/

CentOS 7.5上安裝Node.js搭建Ghost個人博客

host博客

后臺登錄頁面:http://你的ip/ghost

CentOS 7.5上安裝Node.js搭建Ghost個人博客

后臺管理頁面:

CentOS 7.5上安裝Node.js搭建Ghost個人博客

Ghost作為一個新興的博客系統肯定會有一些不足,但是我們相信它會越來越好的,希望大家都能用它來記錄生活中一些美好的時刻,分享自己的精彩的創意,共同建立并且維護這樣一個和諧的互聯網大家庭。

以上搭建過程本人親自操作可用,有問題可留言評論。

贊(0)
分享到: 更多 (0)
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
老司机精品免费视频| 亚洲处破女AV日韩精品| 99在线观看精品视频| 国产午夜精品无码| 久久久精品波多野结衣| 国产成人无码精品一区在线观看| 日韩在线不卡视频| 日韩精品久久久肉伦网站| 四虎AV永久在线精品免费观看| 精品久久久久不卡无毒| 色欲麻豆国产福利精品| 四虎精品在线视频| 国产精品毛片大码女人| 久久夜色撩人精品国产av| 中文无码精品A∨在线观看不卡| 国产成人精品视频播放| 国产成人亚洲精品| 久久成人国产精品免费软件| 亚洲狠狠ady亚洲精品大秀| 精品人伦一区二区三区潘金莲| 99RE久久精品国产| 97久久精品国产成人影院| 99热在线精品国产观看| 精品无码人妻一区二区三区品| 久久精品a亚洲国产v高清不卡| 久久久久女人精品毛片| 四虎国产成人永久精品免费 | 久久精品人人槡人妻人人玩| 国产精品多人p群无码| 国产精品国色综合久久| 香蕉久久夜色精品升级完成| 亚洲精品私拍国产福利在线| 日韩精品无码久久久久久| 99久久综合给久久精品| 在线观看日韩精品| 国产92成人精品视频免费| 97视频热人人精品免费| 狠狠精品干练久久久无码中文字幕 | 精品国产福利一区二区| 久热爱精品视频线路一| 亚洲综合精品成人|