Ghost 认 node 的版本,所以使用 nvm 更好。

1、安装 nvm:

可以去 github 查看 nvm 的说明,通过:wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash 这样的方式下载安装。

2、安装 Ghost 和 unzip

安装 Ghost:curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip 下载最新版 Ghost(如果无法现在,换 wget 命令)

安装 unzip:yum install zip unzip 安装 zip 和 unzip 命令

解压 Ghost:unzip -uo ghost.zip -d ghost

3、配置 Ghost:进入 ghost 目录,修改 config.js 文件里的

    production: {
url: 'http://www.tirion.me', // 修改这里即可
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
}, server: {
host: '127.0.0.1',
port: '2368'
}
},

4、安装 Nginx:yum install nginx

nginx 常用命令:

service nginx start

service nginx restart

service nginx reload

5、配置 Nginx:

cd /etc/nginx 进入 Nginx 目录

cat nginx.conf 可以看到:

http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048; include /etc/nginx/mime.types;
default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf; // 这里可以看到加载的配置文件目录,网上多为 sites-enabled 目录,但是我的是 conf.d 目录
}

cd conf.d 进入配置目录,里面有 default.conf,可以删掉,然后创建自己的 conf。

6、创建 ghost.conf 配置文件:

server {
listen 80; // 监听的端口
server_name www.tirion.me; // 请求的域名
charset utf-8;
location / {
proxy_pass http://127.0.0.1:2368; // 解析到 ghost 的端口
}
}

7、重启 Nginx 生效配置:

service nginx reload

8、安装 forever,可后台运行 node 服务

npm install forever -g

forever 常用命令:

  forever start node文件

  forever stop node文件

9、启动 Ghost 服务

进入安装的 ghost 目录,运行:

NODE_ENV=production forever start index.js

10、访问项目:

通过 www.tirion.me 即可访问 ghost 博客了。

其它:

使用 MySQL:http://www.ghostchina.com/install-ghost-on-ali-ecs-third-step-install-mysql/

安装 Ghost 博客和 Nginx的更多相关文章

  1. 从零开始,CentOS6安装ghost博客

    买了个Bandwagon的VPS来科学上网的,寻思着空间还大顺便做个博客呗. 然后就安装了AMH面板,再搞了个wordpress博客玩玩. 接触到Ghost博客的时候,心血来潮想装一个. 然后就试着搞 ...

  2. window 下如何安装ghost博客

    1.安装nodejs # Node v0.12.x and v4.2+ LTS - supported 我本地安装的是4.2 安装其他版本可能提示系统不兼容 2.安装mysql 3.安装bower 4 ...

  3. docker安装Ghost博客

    1.安装docker-compose curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose ...

  4. Ghost博客安装

    Ghost博客是一个基于Node.js 的开源博客平台,由前WordPress UI 部门主管John O'Nolan 和WordPress 高级工程师Hannah Wolfe 创立,目的是为了给用户 ...

  5. CentOS 7.2 搭建 Ghost 博客

    因为平时记录一些文档或想法基本使用 markdown 的语法,Mac 下推荐一款 markdown 的编辑器 Haroopad:上周无意发现 Ghost 有支持 Mac 的桌面版本了,并且同样开源 h ...

  6. Ubuntu上部署Ghost博客

    所有文章搬运自我的个人主页:sheilasun.me 刚刚成功把自己的ghost博客部署到Linode VPS上了,在这里回顾并顺便整理一下从购买域名到部署代码到服务器的整个过程. 购买域名 万网或者 ...

  7. 在CentOS 7上部署Ghost博客

    作者:waringid 一.简介 跟静态博客不同的是,Ghost 这种轻量级的动态博客,有一个管理后台,可以直接写作和管理博客.本质上,跟 WordPress 是相通的,只是 Ghost 搭建在 No ...

  8. 为Ghost博客扩展代码高亮、数学公式、页面统计、评论

    前几天捣鼓了一下博客首页,接下来再丰富一下博客页面的功能与内容.由于我所使用的Ghost博客专注于轻量简洁,因此标题中提到的功能在Ghost中默认均不支持.下面将逐个介绍一下如何为Ghost扩展这些功 ...

  9. 读Ghost博客源码与自定义Ghost博客主题

    我使用的Ghost博客一直使用者默认的Casper主题.我向来没怎么打理过自己博客,一方面认为自己不够专业,很难写出质量比较高的文字:另一方面认为博客太耗时间,很容易影响正常的工作内容.最近公司即将搬 ...

随机推荐

  1. c语言期末复习题

    代码参考:<K&R> 1.单词计数 #include<stdio.h> #define IN 1 #define OUT 0 main() { int c, state ...

  2. python yield的初识

    ---------2016-5-18 10:49:45-- source:

  3. Monkey 使用aapt查看apk包名

    使用aapt    //aapt是sdk自带的一个工具,在sdk\builds-tools\目录下1.以ES文件浏览器为例,命令行中切换到aapt.exe目录执行:aapt dump badging ...

  4. PHP 小方法之 二维数组排序

    if (! function_exists ( 'multi_array_sort' )) { function multi_array_sort($arr, $keys, $type = 'desc ...

  5. Action<>和Func<> 委托【代理】

    C#中的Action<>和Func<> 其实他们两个都是委托[代理]的简写形式. 一.[action<>]指定那些只有输入参数,没有返回值的委托 Delegate的 ...

  6. gcc -fvisibility=hidden,-fPIC选项

    1. http://www.tuicool.com/articles/fy6Z3aQ 2. http://www.ibm.com/developerworks/cn/linux/l-cn-sdlsta ...

  7. jQuery轮播

    一,简单实现轮播  //轮播容器 .carousel   //轮播容器--可设宽度      (carousel="轮播") //轮播指标 .carousel-indicators ...

  8. mysql分组查询取分组后各分组中的最新一条记录

    SELECT * FROM ( SELECT * FROM `CFG_LOGIN_LOG` ORDER BY LOGTIME DESC ) test GROUP BY login_name DESC

  9. leetcode算法思想快速一览

    整理了一下思路,想深入了解还得多去写,无奈时间紧迫的情况下抛砖引玉也不失为下策: 1.Two Sum Easy 给出一个数组,找出其中两个和为目标值的坐标.思路: [1]排序. 和为目标值,一般的思路 ...

  10. 深入了解css的行高Line Height属性

    什么是行间距? 古时候我们使用印刷机来出来文字.印刷出来的每个字,都位于独立的一个块中. 行间距,即传说中控制两行文字垂直距离的东东.在CSS中,line-height被用来控制行与行之间垂直距离. ...