安装 Ghost 博客

2016-03-12  本文已影响0人  次元碎片

修改说明

  1. 之前的文章是个半成品,但是有不少人看了;
  2. 已成功安装了。

主要内容请参考Ghost 国内站的安装说明。

主要问题 node.js 版本

国内镜像
下载源码包安装,比如官方建议的 Node 0.10.x 版本,xxx.tar.gz。
编译环境

sudo apt-get install build-essential

解压到一个目录后,开始安装:

sudo ./configure
sudo make
sudo make install

Ghost 安装

Ghost 国内站下载 中文完整集成包。
进入目录。

npm install --production

已开发模式启动

npm start

后台运行

安装 forever

$ cd /var/www/ghost # ghost 之前安装到这个文件夹
$ npm install forever -g # 全局安装forever模块
$ NODE_ENV=production forever start index.js # 生产模式后台运行ghost

安装系统服务

$ curl https://raw.githubusercontent.com/TryGhost/Ghost-Config/master/init.d/ghost -o /etc/init.d/ghost # 下载Ghost提供的脚本到/etc/init.d/目录,该目录是系统服务目录
$ chmod +x /etc/init.d/ghost# 给脚本赋予执行权限
$ update-rc.d ghost defaults # 用update-rc.d 安装服务 mousycoder
$ update-rc.d ghost enable # 刷新一遍服务,防止之前有重名的
$ service ghost status # 查看mousycoder 服务的状态
$ service ghost start # 这样开机就会自动启动ghost生产环境,不信reboot一下

摘录自 「搭建Ghost博客」经典教程

升级

备份
Use the export tool on the labs page to create a .json file and make copy of the content folder in the root of your Ghost install – this contains your images and themes.

升级
下载最新版,一般可以是:https://ghost.org/zip/ghost-latest.zip
解压
删除旧文件夹 core 不要删除 content
index.js, packge.json, npm-shrinkwrap.json

npm install --production
service ghost start

参考 官方升级说明文档

上一篇下一篇

猜你喜欢

热点阅读