OpenShift--rhc在Windows的安裝

OpenShift的客戶端工具rhc,是一個強大的命令列工具,可管理帳戶、空間及應用程式。
OpenShift在範例上很多都是以rhc命令來完成的。

要安裝rhc工具之前,必須先安裝兩個軟體:Ruby、Git

Ruby:
印象中之前有安裝過Ruby 2.x,但是忘了能不能相容,不過OpenShift建議可以安裝1.9.3,
所以我這次直接下載Ruby 1.9.3來安裝
官網下載網址:http://rubyinstaller.org/downloads/

安裝的過程只有一個選項要注意,請選擇Add Ruby executables to your PATH。

Git:
直接從官網上下載最新版來安裝。
下載網址:http://msysgit.github.io/

安裝的過程中有兩個選項的設定要注意,如下圖。
第一個是要選擇Run Git from the Windows Command Link Prompt
第二個是要選擇Checkout Windows-style, commit Unix-style line endings


完成上述兩個軟體之後,可以到Windows的命令列(CMD)中來確認版本:
C:\Users\test_user>ruby -v
ruby 1.9.3p551 (2014-11-13) [i386-mingw32]

C:\Users\test_user>git --version
git version 1.9.5.msysgit.1

接著利用gem開始安裝rhc工具
C:\Users\test_user>gem install rhc
Fetching: net-ssh-2.9.2.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: net-ssh-gateway-1.2.0.gem (100%)
Fetching: net-ssh-multi-1.2.1.gem (100%)
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Fetching: highline-1.6.21.gem (100%)
Fetching: commander-4.2.1.gem (100%)
Fetching: httpclient-2.6.0.1.gem (100%)
(略)


第一次要設定rhc的參數:
C:\Users\test_user>rhc setup

(略)
輸入帳號及密碼
Login to openshift.redhat.com: test@look.com
Password: ********
(略)
輸入yes,產生token
Generate a token now? (yes|no)
(略)
輸入yes,自動產生ssh-key
Your public SSH key must be uploaded to the OpenShift server to access code.
Upload now? (yes|no)
(略)
這裡是要輸入key的名稱,如果不在意名稱的話,直接按Enter到下一步
Provide a name for this key: |test6138244|
(略)
最後看到這行訊息表示設定完成了。
Your client tools are now configured.

之後我們就可以使用rhc指令來操作OpenShift的作業了。

Oracle DB的listener.log清理