Ghost是基于Node.js的开源博客系统。 John O'Nolan等以为Wordpress过于臃肿复杂,并且愈来愈多的人将WordPress当成CMS来用,所以决心重头打造一个坚定纯粹的专一于博客的平台——Ghost。node
Ghost开发以前在kickstarter上进行募款,目标是£25,000,结果总共募到了£196,362。nginx
Ghost须要Node.js v0.10.*
。sql
从Ghost.org下载安装包后解压缩,以后运行以下命令安装:npm
npm install --production
使用npm start
命令启动Ghost服务,以后能够在http;//localhost:2368
访问。json
固然,生产环境须要确保Ghost挂了以后能自动重启,前面也须要用反向代理挡一下。segmentfault
Forever
能够在后台运行程序,而且在node进程挂掉以后自动重启。架构
安装forever
:app
npm install forever -g
使用forever
运行Ghost:编辑器
NODE_ENV=production forever start index.js
使用forever stop index.js
来中止Ghost,使用forever list
查看Ghost是否运行。spa
建立/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
将config.js
中的端口替换为18080
,将package.json
中的sqlite3
的值替换为http://bcs.duapp.com/bae-v3/sqlite3-2.1.16.tgz
。(sqlite3的部分文件存储在AWS上,BAE没法链接。)
而后像日常的BAE应用同样新建上传便可。
若是不打算本身部署,也能够直接使用ghost.org的托管服务。
编撰 SegmentFault