CentOS 7.2 搭建 Ghost 博客
因为平时记录一些文档或想法基本使用 markdown 的语法,Mac 下推荐一款 markdown 的编辑器 Haroopad;上周无意发现 Ghost 有支持 Mac 的桌面版本了,并且同样开源 https://github.com/tryghost/ghost-desktop ,这样后面记录一些文档也可以同步到网络上就很方便了,于是重新搭建了一个。
Ghost 是基于 NodeJS 的开源博客平台,由前 WordPress UI 部门主管 John O’Nolan 和 WordPress 高级工程师(女) Hannah Wolfe 创立,目的是为了给用户提供一种更加纯粹的内容写作与发布平台。
#配置 NodeJS 环境
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
tar -xvf node-v6.9.1-linux-x64.tar.xz
#配置环境变量
vi /etc/profile
#输入保存
#set for nodejs
export NODE_HOME=/opt/node-v6.9.1-linux-x64
export PATH=$NODE_HOME/bin:$PATH
export NODE_PATH=$NODE_HOME/lib/node_modules:$PATH
#保存退出
:wq
#生效
source /etc/profile
#检查是否安装成功
node -v
npm –v
#安装Chost
wget https://ghost.org/zip/ghost-0.11.3.zip
unzip -uo ghost-0.11.3.zip -d ghost
#更换源
npm install -g cnpm --registry=https://registry.npm.taobao.org
#更换默认db为 MySQL
cp config.example.js config.js
vi config.js
// ### Production 修改为使用 MySQL 数据库
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://my-ghost-blog.com',
mail: {},
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'username', //用户名
password : '', //密码
database : 'ghost', //数据库名
charset : 'utf8'
}
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},
#启动
yum install screen
screen -S ghost
cnpm install --production
cnpm start --production
#安装Nginx
#http://nginx.org/en/download.html
#安装编译库及依赖模块
yum -y install gcc gcc-c++ autoconf automake make
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
#安装
cd /opt
wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar zxvf nginx-1.10.2.tar.gz
cd nginx-1.10.2
./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_gzip_static_module
make && make install
#测试配置文件是否有错误
/opt/nginx/sbin/nginx -t
#重新加载配置
/opt/nginx/sbin/nginx -s reload
#启动nginx
/opt/nginx/sbin/nginx
#停止nginx
/opt/nginx/sbin/nginx -s stop
#配置HTTPS 模块
// --with-http_ssl_module
#配置
server {
listen 80;
server_name example.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
#未解决问题
- forever 跟阿里 NodeJS 版本有点冲突
- CENTOS 7.2 下配置 supervisor 有些问题 暂时使用 screen 代替
[program:ghost]
command = node /opt/ghost/index.js
directory = /opt/ghost
user = root
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/ghost.log
stderr_logfile = /var/log/supervisor/ghost_err.log
environment = NODE_ENV="production"
REFER:
http://docs.ghostchina.com/zh/installation/deploy/
进程管理supervisor的简单说明
http://www.cnblogs.com/zhoujinyi/p/6073705.html
如何搭建一个Ghost平台的博客?
https://www.zhihu.com/question/22755373
「搭建Ghost博客」经典教程
https://segmentfault.com/a/1190000002947497
CentOS 7.2 搭建 Ghost 博客的更多相关文章
- 在CentOS 7上部署Ghost博客
作者:waringid 一.简介 跟静态博客不同的是,Ghost 这种轻量级的动态博客,有一个管理后台,可以直接写作和管理博客.本质上,跟 WordPress 是相通的,只是 Ghost 搭建在 No ...
- 在Azure中搭建Ghost博客并绑定自定义域名和HTTPS
绪论 之前一直使用cnblog写博客,现在将博客迁移至Microsoft Azure上的Ghost博客上,Ghost博客使用Markdown书写博客,页面简洁,是我喜欢的风格.具体参见官网:https ...
- 运用BT在centos下搭建一个博客论坛
在日常的工作和学习中,我们都很希望有自己的工作站,就是自己的服务器,自己给自己搭建一个博客或者是论坛,用于自己来写博客和搭建网站论坛.现在我们就用一个简单的方法来教大家如何30分钟内部署一个博客网站. ...
- 【ghost初级教程】 怎么搭建一个免费的ghost博客
ghost博客系统无疑是这个月最火热的话题之一,这个号称”只为博客“的系统,早在项目开始之初就受到了众人的关注.它使用了当前最火热node.js技术,10月14日发布了V0.3.3版本.江湖传言它将是 ...
- Centos 7使用docker部署LAMP搭建wordpress博客系统
0.简要概述 LAMP是目前比较流行的web框架,即Linux+Apache+Mysql+PHP的网站架构方案.docker是目前非常流行的虚拟化应用容器,可以为任何应用创建一个轻量级.可移植的容器. ...
- Ghost博客安装
Ghost博客是一个基于Node.js 的开源博客平台,由前WordPress UI 部门主管John O'Nolan 和WordPress 高级工程师Hannah Wolfe 创立,目的是为了给用户 ...
- Flask搭建个人博客网站(1)—项目规划--李渣渣(lizaza.cn)
Flask搭建个人博客网站(1)—项目规划--李渣渣(lizaza.cn) 发布时间:2020-05-2413次浏览 前言 现在市面上又许多比较成熟的博客平台,例如:CSDN,博客园,新浪博客等!对于 ...
- 从零开始,CentOS6安装ghost博客
买了个Bandwagon的VPS来科学上网的,寻思着空间还大顺便做个博客呗. 然后就安装了AMH面板,再搞了个wordpress博客玩玩. 接触到Ghost博客的时候,心血来潮想装一个. 然后就试着搞 ...
- Ubuntu上部署Ghost博客
所有文章搬运自我的个人主页:sheilasun.me 刚刚成功把自己的ghost博客部署到Linode VPS上了,在这里回顾并顺便整理一下从购买域名到部署代码到服务器的整个过程. 购买域名 万网或者 ...
随机推荐
- 如何解决PC端和移动端自适应问题?
做网页时,我们通常需要考虑到不同电脑屏幕尺寸,以及不同手机屏幕大小等问题,解决样式发生改变的情况,那么如何解决呢?现在主要是采用自适应来解决高度,宽度的,以及图片自适应问题,下面就PC端和移动端来总结 ...
- pgsql 常用的命令
pgsql 常用的命令:1. 创建数据库create database name with owner username; 2. 创建用户create role with createdb ;crea ...
- 第八天:JS内置对象-Date日期对象
1.Data对象 日期对象用于处理日期和时间 2.获取当日日期 代码如下: <!DOCTYPE html> <html lang="en"><h ...
- How Delete File with Readonly Permission?
class Program { static void Main(string[] args) { string file=@"E:\readme.txt"; try { File ...
- Android UI开发【开篇导航】
如今移动互联网正处于飞速发展的时期,正式看中这个行业的发展势头,本人在2011年从.NET转行做了移动应用开发这块,接触了android和ios开发,到今已快3个年头,先前忙于学习各种基础知识和语法方 ...
- 你不得不知道的HTML5的新型标签
<article>标签定义外部的内容.比如来自一个外部的新闻提供者的一篇新的文章,或者来自 blog 的文本,或者是来自论坛的文本.亦或是来自其他外部源内容. <aside>标 ...
- 从源代码分析Android-Universal-Image-Loader的缓存处理机制
讲到缓存,平时流水线上的码农一定觉得这是一个高大上的东西.看过网上各种讲缓存原理的文章,总感觉那些文章讲的就是玩具,能用吗?这次我将带你一起看过UIL这个国内外大牛都追捧的图片缓存类库的缓存处理机制. ...
- JsRender实用教程(tag else使用、循环嵌套访问父级数据)
前言 JsRender是一款基于jQuery的JavaScript模版引擎,它具有如下特点: · 简单直观 · 功能强大 · 可扩展的 · 快如闪电 这些特性看起来很厉害,但几乎每个模版引擎, ...
- Installing SCM-Manager
With SCM-Manager, people can share and manage Git, Mercurial and Subversion repositories over http e ...
- highchart 设置双Y轴坐标 双x轴坐标方法
我们的图表一旦引入了两种不同单位或者数量级相差很大的数据以后,这时候需要两种坐标对其进行计量. 下面以设置双Y轴为例, y轴坐标的参数设置成: yAxis: [{ title: { text: '坐标 ...