Ghost博客

Ghost简介

Ghost 是基于 Node.js 构建的开源博客平台,由前 WordPress UI 部门主管 John O’Nolan 和 WordPress 高级工程师 Hannah Wolfe 创立。Ghost 具有易用的书写界面和体验,博客内容默认采用Markdown 语法书写。Ghost 的目标是取代臃肿的 Wordpress。目的是为了给用户提供一种更加纯粹的内容写作与发布平台

安装cnpm模块(因为国内网络的关系,也同时安装了 cnpm 模块,后续将使用该命令代替 npm 命令。)

npm i -g cnpm

安装 Ghost

安装 Ghost Client (ghost-cli)

cnpm i -g ghost-cli
ghost -v

添加 Ghost 运行用户并创建目录

useradd ghost
mkdir /data/ghost
chown -R ghost.ghost /data/ghost/

安装SQLite3 数据库

#新版本不允许root用户安装,需要切换普通用户进行安装。

su - ghost
cd /data/ghost/
ghost install local --db=sqlite3

✔ Checking system Node.js version
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v2.3.0
✔ Finishing install process
✔ Configuring Ghost
✔ Setting up instance
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✔ Validating config
✔ Checking memory availability
✔ Starting Ghost

Ghost uses direct mail by default. To set up an alternative email method read our docs at https://ghost.org/mail

------------------------------------------------------------------------------

Ghost was installed successfully! To complete setup of your publication, visit:

    http://localhost:2368/ghost/

启动 ghost

安装成功后 Ghost 默认就已经启动的

停止host

[ghost@localhost ghost]$ ghost stop
✔ Stopping Ghost

启动ghost

[ghost@localhost ghost]$ ghost start

重启ghos

[ghost@localhost ghost]$ ghost restart

安装成功后默认是运行在http://localhost:2368/
访问:
curl http://localhost:2368/

Nginx和整合nodejs

vim ghost.conf

server {
    listen       80;
    server_name  localhost;
        location / {
        proxy_pass http://127.0.0.1:2368;
        proxy_redirect default;
        }
}

访问

前台页面
http://ip/

后台登录页面
http://ip/ghost

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wuxingge

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值