Contents

OpenShift 基础使用指南一:本地环境搭建

最近B3log社区上线,据说是使用的是OpenShift,相比GAE来说OpenShift的限制要少得多

因为我公司使用的是Windows7故以此平台为基础搭建。

OpenShift简介

http://en.wikipedia.org/wiki/OpenShift

创建帐号

注册地址: https://openshift.redhat.com/app/account/new

安装rhc

要求:

  1. RubyInstaller 1.9 for Windows 确保勾选 “Add Ruby executables to your PATH” [![确保勾选 “Add Ruby executables to your PATH” ](http://nk9i6a.sn2.livefilestore.com/y1pNtIt-QJarhShwR6WayKEN6rMlJgbCxI9QOtT39MG8XGcVRT6Bk13UI-xVuri7icH8BYoj8jmWHAilvOAu_65MQQFtqKFhCW-/openshift-rubyinstall.png?psid=1 “确保勾选 “Add Ruby executables to your PATH” “)](http://nk9i6a.sn2.livefilestore.com/y1pNtIt-QJarhShwR6WayKEN6rMlJgbCxI9QOtT39MG8XGcVRT6Bk13UI-xVuri7icH8BYoj8jmWHAilvOAu_65MQQFtqKFhCW-/openshift-rubyinstall.png?psid=1 “确保勾选 “Add Ruby executables to your PATH” “)

  2. Git for Windows ( 确保勾选 “Run Git from the Windows Command Prompt”) [![ 确保勾选 “Run Git from the Windows Command Prompt”](http://nk9i6a.sn2.livefilestore.com/y1pNtIt-QJarhQClvqUixL3xpWG9gWItAtSakxyo8dIPgEH7H3u9THccYAixViX2liZr9FDE95xqcWf8tsDTwrydTzyUbcC5Yqk/openshift-git-for-windows.png?psid=1 " 确保勾选 “Run Git from the Windows Command Prompt”")](http://nk9i6a.sn2.livefilestore.com/y1pNtIt-QJarhQClvqUixL3xpWG9gWItAtSakxyo8dIPgEH7H3u9THccYAixViX2liZr9FDE95xqcWf8tsDTwrydTzyUbcC5Yqk/openshift-git-for-windows.png?psid=1 " 确保勾选 “Run Git from the Windows Command Prompt”")

  • 推荐都安装最新的, Ruby 1.9.3 和 Git-1.8.0

  • 可参阅安装要求的详细步骤Getting Started Guide

从Windows命令提示符安装 rhc:

  1. 点击"Windows徽标键”, 输入cmd, 点击"Enter”, 启动cmd

  2. 输入"gem install rhc”

1
2
3
4
5


$gem install rhc


  • 有点慢, 略等一会即可安装上 rhc

http://roorta.sn2.livefilestore.com/y1pE2o-bVz3mtlAAX6_W_BzCGadeHakVGWXqXvLImiqYNT5YuT3Imf_8dqeIB38eTPFYg-uX0nawc89-1eoMDB1Vh4TtAS1RUH9/gem-install-rhc.png?psid=1
gem install rhc

配置客户端工具

在windows命令提示符里面输入"rhc setup -l Openshift注册邮箱 “, 不包括引号,回车。
[

http://nk9i6a.sn2.livefilestore.com/y1pFXnn9oJ9LJ4rQTCTiaCpobOV3fnQosApNgJYUgAvMYLXAV2gbRziTZF7v7S439E0tan_-srrzQKPWYWhCD0PXxiSL_NUWdQz/rhc-setup.png?psid=1
rhc setup

](http://nk9i6a.sn2.livefilestore.com/y1pFXnn9oJ9LJ4rQTCTiaCpobOV3fnQosApNgJYUgAvMYLXAV2gbRziTZF7v7S439E0tan_-srrzQKPWYWhCD0PXxiSL_NUWdQz/rhc-setup.png?psid=1 “rhc setup”)

第一次登陆会提示你创建ssh key 输入yes 会自动创建并上传至服务器。你也可以使用命令:“ssh-keygen -t rsa”(不包括引号) 自行创建ssh Key

至此,我们就可以开始往OpenShift 上传自己的应用了。

其实OpenShift官方已经给出了详细的步骤:

2.2 Installing Client Tools

2.3 Configuring Client Tools

本教程参考:https://code.google.com/p/apjp/wiki/InstallGuideOnOpenShift