作者: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博客的更多相关文章

  1. Ubuntu上部署Ghost博客

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

  2. Coding上部署Ghost博客

    Ghost构建于Node.js平台之上.支持0.10.*版本号的Node.js. 在你的本地计算机上执行Ghost事实上非常easy,前提是你已经安装了Node.js. 什么是Node.js? 略过 ...

  3. 在腾讯云上部署Hexo博客

    推荐理由 ----搭建个人的空间博客目前深受个人开发者的追捧,然而博客的种类和平台有很多,Hexo是一个开源的静态博客生成器.相比于其他博客而言它只要是web容器就能用.除了闷头专研技术之外,程序员还 ...

  4. 在 Ubuntu 14.04 服务器上部署 Hexo 博客

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

  5. 码云上部署hexo博客框架

    title: 码云上部署hexo博客框架 Hexo框架在码云上实现个人博客 本文受 https://www.jianshu.com/p/84ae2ba1c133 启发编写 本地调试 安装完Node.j ...

  6. CentOS 7.2 搭建 Ghost 博客

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

  7. 不再忍受龟速 Github,你也可以试试在云开发上部署个人博客!

    Hexo 是被大家广泛使用的静态博客系统, 除了在 Github Pages 部署以外,现在你有了一个新的选择,那就是使用云开发静态网站功能来部署啦! 云开发(CloudBase)是一款云端一体化的产 ...

  8. ubuntu上部署github博客,利用hexo

    安装Node.js三种安装方法,前两种是我安装过的,后一种是 Google 到的. #####①:apt-get 安装在 终端 输入 nodejs 或者 npm ,如果没有安装会提示你进行安装,命令如 ...

  9. 部署ghost博客

    wget https://ghost.org/zip/ghost-0.6.4.zip npm install --production NODE_ENV=production npm start &g ...

随机推荐

  1. HTML之超链接

    图像标签 图像标签为 <img> ,它是行内元素,其主要功能是在网页里面插入图像,所插入图片由属性 scr 属性决定.主要格式为 <img scr="URL"&g ...

  2. [转帖]Linux操作系统中,*.zip、*.tar、*.tar.gz、*.tar.bz2、*.tar.xz、*.jar、*.7z等格式的压缩与解压

    Linux操作系统中,*.zip.*.tar.*.tar.gz.*.tar.bz2.*.tar.xz.*.jar.*.7z等格式的压缩与解压 https://blog.csdn.net/gatieme ...

  3. Spring Boot的web开发

    web开发的自动配置类:org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration 自动配置的ViewResolver 视图的 ...

  4. SpringCloud学习笔记:负载均衡Ribbon(3)

    1. RestTemplate简介 RestTemplate是Spring Resource中一个访问第三方RESTful API接口的网络请求框架. RestTemplate是用来消费REST服务的 ...

  5. less的基本使用

    众所周知,less是一门css预处理语言,其他的类似还有scss.Stylus 等,和js相似度比较高的就是less了.话不多说,我们来看less的使用. Node.js 环境中使用 Less : n ...

  6. sql 找出不包含字母、不包含汉字的数据

    --1.不包含字母 SELECT * FROM t WHERE str NOT LIKE '%[a-zA-Z]%' SELECT * FROM t --2.不包含汉字 SELECT * FROM t ...

  7. python 高阶函数之 map

    以例子来理解 用法1:如函数 f(x) = x * x,用python实现如下 >>> def f(x): ... return x * x >>> r = map ...

  8. Linux系统初始化配置项(centos7)

    主机刚安装完系统,会做一些配置上的优化. 修改时区 通过命令将时区设置为亚洲/上海. timedatectl set-timezone Asia/Shanghai #centos7 cp /usr/s ...

  9. Codeforces 1077D Cutting Out(二分答案)

    题目链接:Cutting Out 题意:给定一个n长度的数字序列s,要求得到一个k长度的数字序列t,每次从s序列中删掉完整的序列t,求出能删次数最多的那个数字序列t. 题解:数字序列s先转换成不重复的 ...

  10. 洛谷P4155 BZOJP4444 [SCOI2015]国旗计划

    自己做出来的第一道倍增(fake) 原题链接 看到题目,贪心水题!不仅思维难度低,代码也好(难)写,三下五除二就写了出来,过了样例.但是一交,只有40pts.一道紫题能让我快速水40pts,良心出题人 ...