如何搭建Ghost博客

  |   Node.js ghost

折腾了一晚上都没睡,都在研究如何建立Ghost的博客,原来这么很简单的,我真的简直无语了。

我就开始介绍Ghost博客,是谁发明这个玩意儿,好像是老外牛人搞的。经过我选择了Ghost博客,因为它有Markdown的功能,适合创作与笔记吧。这个很简单的,可以马上写作你想要的东西。这我不说了Ghost的简介,我知道Ghost博客怎么放在服务器运作呢?好像是Node.js服务器吧。

工具/原料

1.Node.js

2.Nginx

安装/步骤

1.Ghost开源博客平台http://www.ghostchina.com/download/

2.安装之前要确认环境配置
Nodejs版本号:

node -v
v4.2.0
npm -v
2.14.7

这个有了两个安装的版本号,大大放心去搭建Ghost吧

注意:Ghost的要求是Node.js版本不要超过v4.5就行了

3.Nginx的配置:

server {  
    listen 8080;
    server_name localhost;

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

4.在终端执行:

nginx

5.下载好了Ghost文件,然后解压文件

6.Ghost设置:

sudo cp config.example.js config.js

7.我们要对config.js这个文件进行修改:

sudo nano config.js

要看你配置的能力吧,可以参考网上资料吧

8.Mac自带的终端命令:进入Ghost文件目录

cd Ghost

9.然后开启服务

npm start --production 

10.大概会显示:

> ghost@0.7.4 start /Users/zhouyulong/Ghost
> node index

Migrations: Up to date at version 004
Ghost is running in production... 
Your blog is now available on http://localhost:2368 
Ctrl+C to shut down

11.然后浏览器输入http://localhost:2368 可以看到Ghost博客页面

小总结:

我写的东西可能不够完整的,因为略了一些的东西,比方说安装Nginx和Node.js的说明图文等这个没写具体内容。我相信你有聪明的能力和能做到吧。

Ghost作为一个新的博客,和其他的博客是不一样的。虽然它可能有不足的地方,但是我们能相信它会越来越好的。好了,如果你想要建立博客的话,不要放弃自己吧,其实Ghost真的好玩,你可以用它来记录中最美好的时刻,也可以分享你自己的创意吧。

别忘了,如果遇到这个有问题也可以联系我电邮:jinzita007@yahoo.com