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 decorator的理解

    一.decorator的作用 装饰器本质上是一个Python函数,可以让其他函数在不做任何代码变动的前提下增加额外功能. 装饰器的返回值也是一个函数对象.python里函数也是对象. 它经常用于有切面 ...

  2. AC自动机模板

    贴份模板 胡大神和崔大神的组合模板 #include <iostream> #include<cstdio> #include<cstring> #include& ...

  3. ffmpeg从AVFrame取出yuv数据到保存到char*中

    ffmpeg从AVFrame取出yuv数据到保存到char*中   很多人一直不知道怎么利用ffmpeg从AVFrame取出yuv数据到保存到char*中,下面代码将yuv420p和yuv422p的数 ...

  4. dev uploadcontrol 上传图片

    <script type="text/javascript"> // <![CDATA[ function Uploader_OnUploadStart() { ...

  5. Redis设计思路学习与总结

    版权声明:本文由宋增宽原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/222 来源:腾云阁 https://www.qclo ...

  6. iframe 根据加载内容调整高度

    iframe标签代码 <iframe id="checkListFrame" name="checkListFrame"    src="Ind ...

  7. fiddler,https抓包设置

    1.fiddler 2 汉化版本不支持https证书下载,需要下载fiddler 4版本进行验证 若fiddler 2版本,可能存在无法访问Pc端fiddler返回页面,无法下载证书 2.打开Fidd ...

  8. ASP.NET MVC ActionResult的其它返回值

    一.ascx页面 场景:要返回代码片断,比如Ajax返回一个子页 我们先新建一个Action public ActionResult Ascx() { return PartialView(); } ...

  9. 自己封装的一个java图片验证码

    验证码生成器: package com.lz.Tools; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; ...

  10. CentOS7下安装JDK

    1.下载JDK,下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. 测试 ...