树莓派 x1
公网 IP x1
安装 Node 运行环境// 原地址 http://node-arm.herokuapp.com/,为方便国内用户下载建立了镜像wget http://l.eqoe.cn/6pnrdpkg -i *.deb
加速 NPM 下载速度使用下面的命令安装淘宝 NPM 镜像npm install -g cnpm --registry=https://registry.npm.taobao.org
安装 Ghost有人说我为何不用自己的博客系统?首先树莓派的内存很小,不适合运行数据库,而 Ghost 支持 Sqlite ,可以很好的在低端设备运行,其次我也想试一下 Ghost 。不知道tyecho能不能用, 貌似博客志daquan8.com 也是用这个方法?git clone https://github.com/TryGhost/Ghost.gitcd Ghost cnpm install --production
配置cp config.example.js config.jsvi config.js
修改 url 为网站地址
设置 Supervisor 以持久运行apt-get install supervisorvi /etc/supervisor/conf.d/ghost.js填入以下内容[program:ghost]directory = /path/to/ghostcommand = npm start --productionautostart=trueautorestart=true重启 supervisordservice supervisor restart
公网访问在路由器设置端口转发将域名解析到你的 IP,可以使用动态 DNS
Additional Options增加 CDN使用 CDN 缓存页面可以加快访问速度,减轻树莓派的压力。免费的 CDN 有很多,这里就不列举了。