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. (原创)LAMP搭建之二:apache配置文件详解(中英文对照版)

    LAMP搭建之二:apache配置文件详解(中英文对照版) # This is the main Apache server configuration file. It contains the # ...

  2. 【hdu4366】dfs序线段树

    #include <bits/stdc++.h> #define ll long long #define lson l, m, rt<<1 #define rson m+1, ...

  3. Music Review

    (What do you want to do?)(What do you want to do?)(What do you want to do?)(What is the meaning of l ...

  4. jq知识总结

    jQuery   jQuery基本选择器: id选择器     $("#div1") class选择器   $(".div1") 元素选择器   $(" ...

  5. NGUI Atlas, Atlas Type Reference

    在NGUI中,通过创建图集及引用图集,实际使用时指定引用图集而非具体图集本身,可以创建多语言,或高配低配版本资源包. NGUI Atlashttp://www.cnblogs.com/answerwi ...

  6. 6/17 Sprint3

    首页改进:

  7. JavaScript类型判断

    几种方法:typeof,instanceof,Object.prototype.toString,constructor,duck type ES6引入了一种新的原始数据类型Symbol,表示独一无二 ...

  8. django中上传图片的写法(转)

    view参数 @csrf_exemptdef before_upload_avatar(request):    before = True    return render_to_response( ...

  9. jpype调用jar

    import easyguiimport osfrom jpype import * jarpath = "d:\jar"print "jarPath: %s" ...

  10. 三层交换单臂路由vlan间通信综合实验之降龙要点[转]

    单臂路由三层交换机提供vlan间的通信之菜鸟之降龙详解要点: 图示 PC:左到右依次设置IP172.16.10.1,    20.1,  30.1,   40,1  ,50,1  /24 网关10.2 ...