Chapter Two Part Seven Section Five: How To Use Snova On OpenShift

Looking for a simple, stable and significant VPS as your web hosting? Check out DigitalOcean, only $5 per month, and you can get $10 in credit just for signing up now.

To install and use Snova, you can check out this post for GAE, this one for Cloud Foundry and this one for Heroku.

The following will show you how to install and use Snova on OpenShift, another PaaS platform like the above 3 mentioned.

1. Create an OpenShift account

Create an OpenShift account

On the signup page of OpenShift, you can enter your email address, password and the CAPTCHA code to create an account.

2. Download snova-c4-server-xxx.war

Download snova-c4-server

On the Snova Downloads webpage, download the "snova-c4-server-xxx.war" file and put it into a new empty folder, such as "openshift" used for the following steps.

3. Install rhc

Install rhc

On Mac, you can install rhc with the following command line:

sudo gem install rhc

On Windows and Linux, you can check out the official page for the instructions.

4. Deploy Snova c4 server to OpenShift

Deploy Snova c4 server to OpenShift

On the Terminal application, you can enter the openshift folder with the command line:

cd /the-parth-to/openshift

Or you can just drag the "openshift" folder and drop it behind the "cd" command.

After that, you can start to configure and deploy the Snova c4 server to OpenShift by entering the following command lines one by one:

Command line 1:

rhc domain create -n freenutsdot -l [email protected] -p 123456

(To create a sub domain "freenutsdot.rhcloud.com" for your OpenShift account. Remember to change "freenutsdot" to any name you like, to change "[email protected]" to your registered email address and to change "123456" to your OpenShift password. )

Command line 2:

rhc app create -a fn -t jbossas-7 -p 123456

(To create an app, which name will be used before the domain created above. Remember to change "fn" to any name you like, and to change "123456" to your OpenShift password, then you can get a folder with the same name of the app (such as "fn") in your current directory (such as "openshift").

Command line 3:

cd fn

(To conduct commands in the app folder created above.)

Command line 4:

mv ../snova-c4-server-xxx.war deployments/ROOT.war

(To move the "snova-c4-server-xxx.war" file into the "deployments" directory of the "fn" folder and rename it to "ROOT.war".)

Command line 5:

git rm -r src pom.xml

(To delete the src folder and the pom.xml file.)

Command line 6:

git init

(To reinitialize the app.)

Command line 7:

git add .

(To add the ROOT.war mode.)

Command line 8:

git commit -a -m "haha"

(To confirm and see the changes, you can replace "haha" with any message you like.)

Command line 9:

git push

(To upload the ROOT.war file to your OpenShift app.)

If no error appears, you can visit the page of the following URL:

http://fn-freenutsdot.rhcloud.com/

Remember to replace "fn-freenutsdot" with your app name and sub domain.

And if you can see something like the following:

Welcom to snova-c4 server xxx!

(Welcom is a typo, which should be Welcome.)

Then you have successfully deployed the Snova server to OpenShift.

5. Configure the Snova c4 client

Configure the Snova c4 client

Supposing that you have installed Snova on GAE as mentioned before, then you can find and open the "c4-client.conf" file via the following path:

.../snova-xxx/plugins/c4/conf/c4-client.conf

And enter your OpenShift app domain (such as "fn-freenutsdot.rhcloud.com") at the end line of "WorkerNode [0]".

By the way, Snova supports multiple c4 plugins together, so that you can also add the domains of your Cloud Foundry and/or Heroku apps in the same "c4-client.conf" file, just make sure the numbers behind "WorkerNode" are different from each other.

6. Configure snova.conf

Configure Snova.conf

Find and open the "snova.conf" file via the following path:

.../snova-xxx/conf/snova.conf

And change the "ProxyService" value from "GAE" to "C4".

By the way, you can skip this step if you have ever done this before.

7. Start Snova

Start Snova

After that, you can start Snova, and if you can see the following message:

Start plugin:C4 … Success

Then you can visit the HTTPS links normally, as what you can do with the Cloud Foundry or Heroku plugins.

Spread the love
This entry was posted in E-book and tagged , . Bookmark the permalink.