二、建立可以運作 Node.js 的平台(PaaS)及設定 FTP
2.1. 建立可以運作 Node.js 的平台(PaaS)
2.1.1. rhc create-app myapp1 nodejs-0.10
2.1.2. 輸入"rhc ssh"連線到遠端,並測試一下「hello, world」
2.2. 測試Git
2.2.1. 建立測試檔案
echo console.log('hello, world'); > helloworld.js
2.2.2. 檢查目前 Repository 狀態
git status
2.2.3. 將測試檔案加入 Repository
git add helloworld.js
2.2.4. 提交檔案
git commit -m "Add helloworld.js to test git and node.js"
or
git commit -a -m "Add helloworld.js to test git and node.js"
2.2.5. 上傳檔案
git push
PS: 若遇到 "git push error failed to push some refs to" 的問題
請先輸入 "git pull --rebase"
2.3. 設定FTP
2.3.1. 使用 Putty Key Generator 產生公鑰及私鑰
2.3.2. 於 OpenShift 設定 Public Keys 及 Remote Access
2.3.3. 於 FileZilla 加入 SFTP 私鑰檔案設定
2.3.4. 於 FileZilla 加入主機設定(Host、Logon Type、User)
2.3.5. 連線測試一下,OK
參考資料
[1] Installing the OpenShift Client Tools
[2] Getting Started with MongoDB on Node.js on OpenShift
[3] Running Nginx on OpenShift
[4] 《OPENSHIFT》可綁網址、無限流免費雲端主機
[5] 在 OpenShift 上部署 MongoDB 和 Node.js 应用
[6] OpenShift安裝Nginx+MYSQL+PHP5.4









沒有留言:
張貼留言