简介:
利用免费云服务部署个人博客
###一、注册openshift
###二、安装Ghost
点 Applications - Add Applications
找到 Ghost x.x.x 点进去Public URL 随便写如:ghost
拉到下面点 Create Application
###三、配置域名
点 Applications - 进入自己的应用
点Change添加个人域名,Add alia进入新页面填入自己的域名就行了如:www.lxy520.net
进入域名解析如:万网 添加CNAME 指向 应用地址类似: xxx-xxxx.rhcloud.com
打开Git bash
执行1
2cd ~/.ssh
cat id_rsa.pub # 没有的话选运行 ssh-keygen -t rsa -C “您的邮箱地址”
到 Settings - Add a new key...
复制id_rsa.pub里的内容到大的编辑框,第一行名称可以随便写,然后保存
然后复制应用页面的 Source Code 类似: `xxxx@xxx-xxxx.rhcloud.com` 的地址
在Git bash 执行:
1 | ssh xxxx@xxx-xxxx.rhcloud.com #如: ssh 5581340d50044601a3000167@ghost-ystyle.rhcloud.com |
远程到openshift后(可以用其它工具连接如xshell)
1 | 安装主题 其它主题下载:http://marketplace.ghost.org/ |
1 | 配置Ghost博客 |
1 | 实现openshift自动重启 |
1 | 重启应用, 安装主题与修改config.js 时需要重启应用 |
###四、初始化博客
用自己的域名进入博客,在地址栏加上/ghost
输入用户名,邮箱,密码初始化博客
完成之后, 后台页面 content 管理文章,New post发布博客, Setting设置博客基本信息