腾讯云安装ghost博客记录

chen'mo
2016-04-07 / 0 评论 / 2,068 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于1970年01月01日,已超过19810天没有更新,若内容或图片失效,请留言反馈。

最近弄了个腾讯云,按网上的教程装个ghost博客老是出错。经过几天的折腾,终于找到了方法,记录如下,方便下次安装。

 

准备条件:

腾讯云操作系统 Ubuntu Server 14.04.1 LTS 64位
nginx版本 1.8

node版本 v0.10.40(目前Ghost官方建议的版本)

ghost版本  0.74中文版 http://dl.ghostchina.com/Ghost-0.7.4-zh-full.zip

注意下node的版本,目前最新的是4.几和5.几的,老是出错。 ghost选中文版就可省掉安装依赖包了。

 

开工:

1、腾讯云直接选镜像安装Ubuntu Server 14.04.1 LTS 64位。

2、putty 连接腾讯云,

sdu password root

输入密码提权

su切换到root用户方便接下来安装软件

3、系统更新


 

apt-get update
apt-get upgrade
apt-get install python software-properties-common gcc g++ make -y 
add-apt-repository ppa:chris-lea/node.js -y

4、安装nginx

apt-get install nginx

打开服务器IP,检查nginx是否安装成功。

 

5、安装node v0.10.40

wget http://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz 
tar zxvf node-v0.10.40.tar.gz 
cd node-v0.10.40 
./configure 
make && make install

检查node安装成功: node -v

 

6、安装ghost 先创建/var/www/ (命令:mkdir /var/www)

wget http://dl.ghostchina.com/Ghost-0.7.4-zh-full.zip
unzip Ghost-0.7.4-zh-full.zip -d ghost
cd ghost

中文版可以省掉npm install --production 直接运行ghost

npm start

检查是否成功。对于config.js配置文件不在本文介绍中了。

 

7、配置nginx反向代理

cd /etc/nginx/sites-available/ 

直接把默认的default的内容修改为:

server {  
    listen 80;
    server_name im.cmsblog.cn;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

service nginx restart


重启就成功了。

8、最后用PM2让ghost永远在线

//!!首先进到ghost的安装目录
//安装pm2
npm install pm2 -g  
//让ghost以production模式运作,指定程序的入口index.js,并且此进程命名为ghost
NODE_ENV=production pm2 start index.js --name "ghost"  
//开机启动
pm2 startup centos  
pm2 save  

ghost博客简洁大气,就是安装难度较大,得须vps或云服务器,费用较贵。

0
那一年 · 4月7日
799元魅蓝Note3正式发布
« 上一篇 04-06
最新免费帆樯神器 灯笼Lantern下载及使用教程
下一篇 » 04-12

评论 (0)

插入图片