在CentOS 7上部署Ghost博客
作者:waringid
一、简介
跟静态博客不同的是,Ghost 这种轻量级的动态博客,有一个管理后台,可以直接写作和管理博客。本质上,跟 WordPress 是相通的,只是 Ghost 搭建在 Node.js 环境上,轻量,快速,简洁。
二、更新操作系统
首先更新系统版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum makecache
yum update
三、安装nginx
配置安装源
vi /etc/yum.repo.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
安装并启动nginx
yum install nginx
systemctl enable nginx
systemctl start nginx
ps -ef |grep nginx
配置nginx
vim /etc/nginx/conf.d/blog.conf
server {
listen 80;
server_name blog.waringid.me // 这里修改为你的域名;如果没有域名,则输入服务器公网 IP 地址;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
四、安装Node.js
安装nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
source .bashrc
nvm ls
nvm install 4.2
安装Ghost
curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
unzip -uo ghost.zip -d /var/www/html/ghost
chown -R nginx:nginx /var/www/html/ghost/
cd /var/www/html/ghost/
npm install --production
cp config.example.js config.js
vim config.js
production: {
url: 'http://blog.waringid.me',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2368'
}
},
安装PM2
npm install -g pm2
NODE_ENV=production pm2 start index.js --name "ghost"
pm2 startup centos
pm2 save
systemctl reload nginx

五、测试

转载请注明:虚拟的现实 » 在CentOS 7上部署Ghost博客
在CentOS 7上部署Ghost博客的更多相关文章
- Ubuntu上部署Ghost博客
所有文章搬运自我的个人主页:sheilasun.me 刚刚成功把自己的ghost博客部署到Linode VPS上了,在这里回顾并顺便整理一下从购买域名到部署代码到服务器的整个过程. 购买域名 万网或者 ...
- Coding上部署Ghost博客
Ghost构建于Node.js平台之上.支持0.10.*版本号的Node.js. 在你的本地计算机上执行Ghost事实上非常easy,前提是你已经安装了Node.js. 什么是Node.js? 略过 ...
- 在腾讯云上部署Hexo博客
推荐理由 ----搭建个人的空间博客目前深受个人开发者的追捧,然而博客的种类和平台有很多,Hexo是一个开源的静态博客生成器.相比于其他博客而言它只要是web容器就能用.除了闷头专研技术之外,程序员还 ...
- 在 Ubuntu 14.04 服务器上部署 Hexo 博客
版权声明:本文由宋秉金 原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/241080001487926962 来源:腾云阁 ...
- 码云上部署hexo博客框架
title: 码云上部署hexo博客框架 Hexo框架在码云上实现个人博客 本文受 https://www.jianshu.com/p/84ae2ba1c133 启发编写 本地调试 安装完Node.j ...
- CentOS 7.2 搭建 Ghost 博客
因为平时记录一些文档或想法基本使用 markdown 的语法,Mac 下推荐一款 markdown 的编辑器 Haroopad:上周无意发现 Ghost 有支持 Mac 的桌面版本了,并且同样开源 h ...
- 不再忍受龟速 Github,你也可以试试在云开发上部署个人博客!
Hexo 是被大家广泛使用的静态博客系统, 除了在 Github Pages 部署以外,现在你有了一个新的选择,那就是使用云开发静态网站功能来部署啦! 云开发(CloudBase)是一款云端一体化的产 ...
- ubuntu上部署github博客,利用hexo
安装Node.js三种安装方法,前两种是我安装过的,后一种是 Google 到的. #####①:apt-get 安装在 终端 输入 nodejs 或者 npm ,如果没有安装会提示你进行安装,命令如 ...
- 部署ghost博客
wget https://ghost.org/zip/ghost-0.6.4.zip npm install --production NODE_ENV=production npm start &g ...
随机推荐
- openstack基础:网络
Neutron 功能 Neutron 为整个 OpenStack 环境提供网络支持,包括二层交换,三层路由,负载均衡,防火墙和 *** 等.Neutron 提供了一个灵活的框架,通过配置,无论是开源还 ...
- 排序算法(sorting)
学习到的排序算法的总结,包括对COMP20003中排序部分进行总结,部分图片来自COMP20003 有部分内容来自http://www.cnblogs.com/eniac12/p/5329396.ht ...
- flask 状态保持session和上下文session的区别
问题场景: 在falsk项目中导入了两个session: 首先,配置文件config.py文件中 有个 flask_session扩展导入了Session ( from flask_sessi ...
- SPP-net原理解读
转载自:目标检测:SPP-net 地址https://blog.csdn.net/tinyzhao/article/details/53717136 上文说到R-CNN的最大瓶颈是2k个候选区域都要经 ...
- Time travel HDU - 4418(高斯消元)
Agent K is one of the greatest agents in a secret organization called Men in Black. Once he needs to ...
- Linux端口被占用的解决(附Python专版)
先说一般情况的解决: lsof -i:8000 查出PID,然后 kill掉程序,接着就可以了 软件重启之后绑定没有释放,lsof -i:8080也查不出来占用的情况 再来个长连接版Python解决法 ...
- 初识 go 语言:方法,接口及并发
目录 方法,接口及并发 方法 接口 并发 信道 结束语 前言: go语言的第四篇文章,主要讲述go语言中的方法,包括指针,结构体,数组,切片,映射,函数闭包等,每个都提供了示例,可直接运行. 方法,接 ...
- kafka partition(分区)与 group
kafka partition(分区)与 group 一. 1.原理图 2.原理描述 一个topic 可以配置几个partition,produce发送的消息分发到不同的partition中,co ...
- jQuery使用(十二):工具方法之type()之类型判断
type()的使用 类型判断方法之is...() 实现原理可以参考我的另一篇js源码剖析博客: 类型和原生函数及类型转换(二:终结js类型判断) $.type( undefined ) === &qu ...
- CSS盒模型深入理解
前言 所有文档元素都生成一个矩形框,这称为元素框(element box),它描述了一个元素在文档布局中所占的空间大小.而且,每个框影响着其他元素框的位置和大小 宽高 宽度width被定义为从左内边界 ...