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. python成长之路【第四篇】:装饰器

    实现装饰器的知识储备: 示例: def f1(): print("f1") 1.函数即“变量” #上面的示例中,函数f1为变量,它指向内存地址.而f1()表示函数执行. 2.高阶函 ...

  2. linux 之SCP

    一.从本地到远程复制 1.复制文件 * 命令格式: 1.scp -P remote_port local_file remote_username@remote_ip:remote_folder 或者 ...

  3. hdu3341Lost's revenge(ac自动机+dp)

    链接 类似的dp省赛时就做过了,不过这题卡内存,需要把当前状态hash一下,可以按进制来算出当前的状态,因为所有的状态数是不会超过10*10*10*10的,所以完全可以把这些存下来. 刚开始把trie ...

  4. 手机号 和 email 的正则匹配

    手机号   /^1[3|4|5|8] \d{9}$/ email  /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/

  5. null和undefined

    null表示"没有对象",即该处不应该有值.典型用法是: (1) 作为函数的参数,表示该函数的参数不是对象. (2) 作为对象原型链的终点. undefined表示"缺少 ...

  6. html5-表单

    例子: text,number,email 的输入框 <!-- required:必填项 --> <!-- autofocus:获得焦点 --> <!-- placeho ...

  7. hdu----1686 Oulipo (ac自动机)

    Oulipo Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  8. JavaScipt 源码解析 数据缓存

    常见的内存泄露的几种情况: 循环引用 JavaScript闭包 DOM插入 一个DOM对象被一个JavaScript对象引用,同时又引用同一个或其他的JavaScript对象,这个DOM对象可能回引发 ...

  9. Js获取后台集合List的值并操作html

    功能:将后台传到前端JSP的List中的float型数值转换为百分比显示 HTML代码: <s:iterator value="colorConfigList" status ...

  10. 我也来SplashScreen

    SplashScreen,就是平时我们说的溅射屏幕,任何一个做过客户端程序的coder应该对它都不陌生,因为它能提升用户体验,让软件看上去更美.SplashScreenForm通常进入程序时是打开,主 ...