2014-07-16 19:05:11 +02:00
Openshift Paas
===========
The following are installation instructions for the `Openshift <http://openshift.com>` Paas.
**Step 1:** Create a new application :
.. code :: bash
rhc app create nodebb nodejs-0.10
The nodebb command after the git url will create a file called nodebb so you have to CD into the file after you have cloned NodeBB.
**Step 2:** Add cartridge MongoDB
.. code :: bash
rhc cartridge add mongodb-2.4 -a nodebb
2014-07-16 21:53:28 +02:00
**Step 3:** SSH to the application
2014-07-16 19:05:11 +02:00
.. code :: bash
rhc app ssh -a nodebb
2014-07-16 21:53:28 +02:00
**Step 4:** Find out your instance’ s ip address NodeJS and MongoDB 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 : MongoDB
2014-07-16 19:05:11 +02:00
.. code :: bash
echo $OPENSHIFT_NODEJS_IP && echo $OPENSHIFT_MONGODB_DB_HOST
2014-07-16 21:53:28 +02:00
**Step 5:** Exit SSH
2014-07-16 19:05:11 +02:00
2014-07-16 21:53:28 +02:00
**Step 6:** Add the source code of Nodebb to the repository application
2014-07-16 19:05:11 +02:00
.. code :: bash
cd nodebb && git remote add upstream -m master git://github.com/NodeBB/NodeBB.git
2014-07-16 21:54:30 +02:00
**Step 7:** Get the files and push
2014-07-16 19:05:11 +02:00
.. code :: bash
git pull -s recursive -X theirs upstream master && git push
2014-07-16 21:54:30 +02:00
**Step 8:** SSH to the application
2014-07-16 19:05:11 +02:00
.. code :: bash
rhc app ssh -a nodebb
2014-07-16 21:53:28 +02:00
2014-07-16 21:54:30 +02:00
**Step 9:** In other terminal, stop the application
2014-07-16 21:53:28 +02:00
.. code :: bash
rhc app stop -a nodebb
2014-07-16 19:05:11 +02:00
2014-07-16 21:54:30 +02:00
**Step 10:** Edit the environnement NodeJS on the terminal with the SSH
2014-07-16 19:05:11 +02:00
.. code :: bash
2014-07-16 21:53:28 +02:00
cd ~/nodejs/configuration && nano node.env
2014-07-16 19:05:11 +02:00
2014-07-16 21:54:30 +02:00
**Step 11:** Replace server.js by app.js and exit the editor
2014-07-16 19:05:11 +02:00
.. code :: bash
ctrl + x
2014-07-16 21:53:28 +02:00
2014-07-16 21:54:30 +02:00
**Step 12:** In other terminal, start the application
2014-07-16 21:53:28 +02:00
.. code :: bash
rhc app start -a nodebb
2014-07-16 19:05:11 +02:00
2014-07-16 21:54:30 +02:00
**Step 13:** Start the setup of NodeBB on the terminal with the SSH
2014-07-16 19:05:11 +02:00
.. 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
2014-07-16 21:53:28 +02:00
IP or Hostname to bind to: Enter what your $OPENSHIFT_NODEJS_IP value holds here found in step 4.
2014-07-16 19:05:11 +02:00
2014-07-16 21:53:28 +02:00
Host IP or address of your MongoDB instance: Enter what your $OPENSHIFT_MONGODB_DB_HOST value holds here found in step 4.
2014-07-16 19:05:11 +02:00
2014-07-16 21:53:28 +02:00
Host port of your MongoDB instance: 27017
2014-07-16 19:05:11 +02:00
2014-07-16 21:53:28 +02:00
MongoDB Admin Password: When you have added the cartridge MongoDB, the terminal give you a password, use it. If you are lost him, you will find it on the [Openshift Panel](https://openshift.redhat.com/app/console).
2014-07-16 19:05:11 +02:00
2014-07-16 21:54:30 +02:00
**Step 14:** And the last one, in other terminal, restart the application
2014-07-16 19:05:11 +02:00
.. code :: bash
2014-07-16 21:53:28 +02:00
rhc app restart -a nodebb
2014-07-16 19:05:11 +02:00
2014-07-16 21:53:28 +02:00
And then open http://nodebb-username.rhcloud.com in your browser.