Skip to content

Commit

Permalink
Merge pull request #42 from Firelad97/Firelad97-patch-1
Browse files Browse the repository at this point in the history
Updated to make it more clear
  • Loading branch information
psychobunny committed May 21, 2015
2 parents c932c3f + 172a668 commit 498e87d
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions installing/cloud/openshift.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
Openshift Paas
Openshift PaaS
===========

The following are installation instructions for the `Openshift <http://openshift.com>` PaaS.

**Step 1:** Create a new application :
Before we begin, you need to install rhc command-line at <https://developers.openshift.com/en/managing-client-tools.html>.

**Step 1:** Create a new application. This will create a git repository as well, keep this in mind.

.. code:: bash
rhc app create nodebb nodejs-0.10
**Step 2:** Add cartridge Redis
**Step 2:** Add cartridge Redis.

.. code:: bash
rhc add-cartridge http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart -a nodebb
**Step 3:** SSH to the application
**Step 3:** Access SSH using this command. This will go in your app you just created.

.. code:: bash
rhc app ssh -a nodebb
**Step 4:** Find out your instance’s ip address NodeJS and Redis so NodeBB can bind to it correctly. This is one of Openshift’s demands and seems to be the only way it will work. You can’t use $IP in your config.json either (which means you can’t enter $IP in the node app –setup). First line : NodeJS and second line : Redis
The ouput of the echo $REDIS_CLI like this : -h ip_redis -p port_redis -a password
**Step 4:** Due to one of Openshift's demands, we have to know IP of your app, IP of redis database, PORT of redis database, and PASSWORD of redis database. Save them somewhere.

.. code:: bash
Expand All @@ -45,73 +46,75 @@ or...
flushdb
**Step 5:** Exit SSH
**Step 5:** Exit SSH using this command.
.. code:: bash
**Step 6:** Add the source code of Nodebb to the repository application
exit
**Step 6:** You'll need clone NodeBB from Github to your app. The command git clone will not work with Openshift.
.. code:: bash
cd nodebb && git remote add upstream -m master https://github.com/NodeBB/NodeBB.git
**Step 7:** Get the files
**Step 7:** Then pull the files from NodeBB's repository.
.. code:: bash
git pull -s recursive -X theirs upstream v0.6.x
**Step 8:** Stop the application
**Step 8:** Now you will need to commit and push files to your app's repository. Replace message with your message.
.. code:: bash
git commit -a -m 'message' && git push
**Step 9:** Stop the application
.. code:: bash
rhc app stop -a nodebb
**Step 9:** SSH to the application
**Step 10:** Access SSH again.
.. code:: bash
rhc app ssh -a nodebb
**Step 10:** Edit the environnement NodeJS on the terminal with the SSH
**Step 11:** Edit the environnement NodeJS on the terminal with SSH.
.. code:: bash
cd ~/nodejs/configuration && nano node.env
**Step 11:** Replace server.js by app.js and exit the editor
**Step 12:** Replace server.js by app.js and exit the editor.
.. code:: bash
ctrl + x
**Step 12:** You will need to update the app and push it. Replace message with your own message. (Make sure you're in NodeBB folder.)
.. code:: bash
git commit -a -m 'message' && git push
**Step 13:** In other terminal, start the application
**Step 13:** In other terminal, start the app.
.. code:: bash
rhc app start -a nodebb
**Step 14:** Start the setup of NodeBB on the terminal with the SSH
**Step 14:** Start the setup of NodeBB on the terminal with SSH.
.. code:: bash
cd ~/app-root/repo && node app --setup
URL of this installation should be set to 'http://nodebb-username.rhcloud.com', replacing username with your username.
Port number : 8080
URL of this installation should be set to 'http://nodebb-username.rhcloud.com:8080', replacing username with your username.
Host IP or address of your Redis instance: Enter what your $REDIS_CLI value holds here found in step 4.
Host port of your Redis instance: Enter what your $REDIS_CLI value holds here found in step 4.
Redis Password: Enter what your $REDIS_CLI value holds here found in step 4.
**Step 15:** Manually Set the Bind Address for NodeJS
**Step 15:** Manually Set the Bind Address for NodeJS. (Uncomfirmed if works. Omit this step if you want.)
The last step in this process is changing the configuration file ( ~/app-root/repo/config.json ) that is
automatically generated by NodeBB
Expand All @@ -134,11 +137,12 @@ I've attached an example of what a config file may look like below
}
}
**Step 16:** And the last one, in other terminal, restart the application
**Step 16:** And the last one, in other terminal, stop and then start the app.
.. code:: bash
rhc app restart -a nodebb
rhc app stop -a nodebb
rhc app start -a nodebb
And then open http://nodebb-username.rhcloud.com in your browser.
Expand Down

0 comments on commit 498e87d

Please sign in to comment.