Ghost 基于Node.js的开源博客系统

Ghost是基于Node.js的开源博客系统。 John O'Nolan等以为Wordpress过于臃肿复杂,并且愈来愈多的人将WordPress当成CMS来用,所以决心重头打造一个坚定纯粹的专一于博客的平台——Ghost。node

ghost blog

Ghost开发以前在kickstarter上进行募款,目标是£25,000,结果总共募到了£196,362。nginx

特性

  • 基于Node.js采用实时架构,提高了访问体验。
  • 简洁清亮,部署完成后只占用30M不到的空间。
  • Markdown编辑器,良好的撰写体验。
  • 部署简单,下降了自建博客的门槛。
  • 界面清爽优雅,后台采用响应式设计,移动设备上也能够撰写博客。

部署

Ghost须要Node.js v0.10.*sql

Ghost.org下载安装包后解压缩,以后运行以下命令安装:npm

npm install --production

使用npm start命令启动Ghost服务,以后能够在http;//localhost:2368访问。json

固然,生产环境须要确保Ghost挂了以后能自动重启,前面也须要用反向代理挡一下。segmentfault

Forever

Forever能够在后台运行程序,而且在node进程挂掉以后自动重启。架构

安装foreverapp

npm install forever -g

使用forever运行Ghost:编辑器

NODE_ENV=production forever start index.js

使用forever stop index.js来中止Ghost,使用forever list查看Ghost是否运行。spa

Nginx

建立/etc/nginx/sites-available/ghost.conf文件,内容以下:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
    }
}

注意用你的域名替换example.com

使用sites-enabled激活配置,并重启nginx:

sudo ln -s /etc/nginx/sites-available/ghost.conf /etc/nginx/sites-enabled/ghost.conf
sudo service nginx restart

部署到BAE

config.js中的端口替换为18080,将package.json中的sqlite3的值替换为http://bcs.duapp.com/bae-v3/sqlite3-2.1.16.tgz。(sqlite3的部分文件存储在AWS上,BAE没法链接。)

而后像日常的BAE应用同样新建上传便可。

托管

若是不打算本身部署,也能够直接使用ghost.org的托管服务


编撰 SegmentFault

相关文章
相关标签/搜索