在 vps 安装 Ghost 博客系统记录
来源:互联网 发布:软件生成周期模型 编辑:程序博客网 时间:2024/05/17 15:05
在 vps 安装 Ghost 博客系统记录
- 前期准备
如果VPS系统比较差的话,安装必备的东西;
apt-get update apt-get -y upgrade apt-get install -y build-essential vim curl unzip
- 安装nodejs 和 npm
curl -sL https://deb.nodesource.com/setup | bash - apt-get install -y nodejs
- 安装ghost
首先进入你想要安装的目录
curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip npm install --production npm start
这样装好后,外网是访问不道德,因为只监听了127.0.0.1的请求,我们就修改config.js来设定,但是我们一般在前段用nginx做中转。
- 安装并配置nginx
apt-get install -y nginx rm /etc/nginx/sites-enabled/default vi /etc/nginx/sites-available/ghost.conf
ghost.conf 的内容如下(注意替换里面的域名和配置域名指向):
server { listen 80; server_name example.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; } }
创建链接:
ln -s /etc/nginx/sites-available/ghost.conf /etc/nginx/sites-enabled/ghost.conf
启动nginx:
service nginx start
(多次重启可能才会有效)
这个时候你使用域名就可访问到了。
- 配置后台运行
后台运行有很多方式,比如 forever 、Supervisor 等等。 - 使用 forever 以后台任务运行 Ghost
安装 forever
npm install forever -g
运行 Ghost
NODE_ENV=production forever start index.js
然后可以通过
forever stop index.js
停止 Ghost
也可以通过
forever list
检查 Ghost 是否运行
0 0
- 在 vps 安装 Ghost 博客系统记录
- 在 vps 安装 Ghost 博客系统记录
- VPS 教程:Ubuntu 14.04 如何安装 Node.js 以及 Ghost 博客程序?
- 在virtualBox中用ghost安装XP系统
- VPS安装记录
- 如何在Linux平台上安装Ghost博客平台
- 如何在Linux平台上安装Ghost博客平台
- 在digitalocean droplet上安装博客平台ghost
- ghost安装系统
- ghost安装系统
- ghost快速安装系统
- vmware 安装ghost 系统
- 从零开始,CentOS6安装ghost博客
- ghost 安装在bae
- 在樱花vps上安装win系统(上)
- 在樱花vps上安装win系统(下)
- 在Ghost系统上安装Agent不显示的问题
- 教你在WinPE下用GHOST安装系统
- Windows7中双击py文件运行程序
- UIColor+BeeExtension
- Spring技术内幕之Spring Data JPA-查询方式
- java异常及处理
- HDU 1297:Children’s Queue
- 在 vps 安装 Ghost 博客系统记录
- UIView的layoutSubviews和drawRect方法何时调用
- UWP开发笔记——嵌套式页面的实现
- 逗逼的生活
- ssh 工具查看日记的几个命令
- 实例讲解ARM指令集
- Tomcat安装步骤
- log4j工作原理
- 判断任意两台计算机的IP地址是否属于同一子网络(华为OJ)