Cloud with Redhat OpenShift Flex

Revision as of 13:58, 4 May 2014 by Gpaint (talk | contribs)

En verysmall.png Page waiting to complete. To complete, create an account, go back and clic on "Modify".
Fr verysmall.png Page en attente d'être complété. Pour compléter, créez un compte, revenez et cliquez sur "Modifier".
Es verysmall.png Página a completar. Para completarla, cree una cuenta, vuelva a la página y haga clic en "editar"
De verysmall.png Seite wartet auf Vervollständigung. Um zu helfen, erstelle ein Konto, gehe zurück und klicke auf "Bearbeiten".
Cn verysmall.png 待完成,欲帮助完成,注册帐号,点击“编辑"
Jp verysmall.png ページは未完成の状態です。完成させるにはアカウントを作成し、ページに戻って「編集」をクリックして下さい。

This page is a tutorial to explain how to install Dolibarr ERP-CRM on the Redhat OpenShift Flex Platform www.openshift.com

Image1
Url openshift.JPG

A little about OpenShift.

OpenShift Platform as a Service

OpenShift is Red Hat's Platform-as-a-Service (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment. With OpenShift you have choice of offerings, including online, on premise, and open source project options.

OpenShift provides help to build and deploy web applications, mobile backends, service-oriented architectures, and get your favorite services.

Openshfit works with Gears and Cartridges, which are terms with which we have to familiarize ourselves.

What's a Gear?
A gear is a resource-constrained container that runs one or more user-specified software stacks, also known as cartridges. Each gear has a limited amount of RAM and disk space. If an application needs more resources, it can be configured to automatically use more gears.

How Do Gears Work?
Let's look at an example Drupal-based app running on OpenShift. We can estimate the needs and costs of the app at different stages. 15 pages/second Hundreds of articles ~ 50k visitors per month 3 Small Gears Free plan

As we see, a free plan, it may be sufficient for a small or medium company. For larger companies, you can switch to the next plan.

In OpenShift, we have two possibilities, to launch Dolibarr.

1 -. As developers, it gives us the ability to extend or create your own modules.
2 -. As entrepreneurs, it gives us the opportunity to put into production our Dolibarr.

Advantages offered OpenShift.

It is a secure site, which is accessed through SSH.

It is scalable Application scaling enables your application to react to changes in traffic and automatically allocate the necessary resources to handle your current demand. The OpenShift infrastructure monitors incoming web traffic and automatically brings copies of your web cartridge online to handle requests.

It gives total control on our database to connect remotely via a GUI client HeidySQL.

If opt for MySql, we feature the InnoDB engine, essential for transactions.

It gives us the possibility to share SSL Certificates RedHat or customize our own SSL, if you have one. Essential to send our data both login or bank transfers, encrypted and secure.


Create an account

Click in SING UP

 

Fill our data to create an account. Click in Sign Up

They will send an email to your email account to confirm. Click in Verify your Account.

Click LOG IN back and show us the initial aspect of our console applications.

Image 4
 

Click in Create your first application now

Choose a web programming cartridge

Image 5
 

1. Choose a type of application

Image 6
 

2. Configure the application.

It is important to define the domain name, for this tutorial well, we used sdme. The domain, you cannot change it unless, we delete all our applications and start again from scratch and that is something that nobody wants.

Also, we will have to report, if we have an external git repository with our code.

Here comes the fun part.

In scaling change to Scale with webtraffic.

The creation of this application, used a Gear of the 3 that we have, indicates precisely next to the Create Application button.

Click in Create Application.

Image 7
 

When the application is scalable, you cannot add more Cartridges, the Gear. For example we do want to use MySQL, you must go apart, another Gear.

In the image above, we see that our Gear, has added the load balancer, which will make our scalable application.

Up on the right end, there is also a button, in case we need to restart the Gear.

Note. - With PuTTY, we could resolve more explicit requirements to control our Gears with command line.

Click on the link Web load Balancer.

Image 8
 

HAProxy in Action.

Image 9
 

If we see our url startdolibarr-sdme.rhcloud.com this is the initial appearance, it has.


second part of our tutorial

So far so good. Now to the second part of our tutorial.

For this part, will be referred to the administration of our application, there are two ways, the first is by CLI (command line based Ruby) and the second, more declarative form, console and SSH.

I chose the easiest way I've intuitive, which is the second option for this tutorial.

Hands to work.

We need a SSH / FTP client like WinSCP and PuTTY.

We download and install.

Image 10
 

Inside the folder where you installed WinSCP, find the folder PuTTY and inside this folder, the puttygen.exe program, this program is important because it is the one that will help us generate our SSH access, to connect to our Gear.

Click in puttygen.

image 11
 

We leave the default values, SSH-2 RSA, and the number of bits in 2048.

With these values and will have a key, heavily encrypted.

Image 12
 

To generate our key, we must move the mouse pointer constantly in the blank space of program.

Image 13
 

Once our key generation is complete, we will add a passphrase.

Click Save public key to save our public key, we give the name of rsa.pub, do the same with save private key, and give the name of rsa.ppk.

A public key is like a lock on a door and the private key is like a key that opens the lock.

We mark the generated code in the text area and copy it, then we go to our OpenShift console.

Image 14
 

Paste the code into Paste the contents of your public key file (. Pub) and click Save.

Image 15
 

Perfect OpenShift now has our lock and we have the key.

Now we go to the Applications tab in our console OpenShift.

Click on our application startdolibarr.

Click in Want to log in to your application?.

Image 16
File:SourceCode and Remote Access.JPG500px

Copy the code ssh 53641a41e0b8cdf5ec000b76@startdolibarr-sdme.rhcloud.com

We opened our WinSCP.

Image 17
 

We put the first part, 53641a41e0b8cdf5ec000b76 before the @ in the User name field, and the second part, startdolibarr-sdme.rhcloud.com after the @ in the Host name field.

It is advisable not to place the password / passphrasse, at this point, for security reasons. We'll use it later.

Click in Advanced.

Image 18
 

In Private key file: select your private key rsa.ppk, click OK, click save, and click Login.

Image 19
 

When we leave this nice window click Yes.

Image 20
 

Here we place our passphrase and click OK.

Image 21
 

Viola we have access via SSH to our Gear.

On the left is our local space and right remote.

Image 22
 

We went down the generic version of Doibarr.

Image 23
 

In the remote part, selected route /var/lib/openshift/53641a41e0b8cdf5ec000b76/app-root/runtime/repo

Transfer the Dolibarr folder on the local machine to OpenShift, pressing F5. This process may take several minutes, so while we wait, we will work to create our Gear for the database.


Image 24
 

We return to the console and with our OpenShift application selected, we click on the bottom of the Databases section and select Add MySQL 5.5

Image 25
 

Click in add Cartridge.

Note -. In a normal application without Scale, the Cartridge Mysql be added to current Gear, but in our case, OpenShift reports that will address a new Gear for MySQl.

Image 26
 

Copy the MySQL access credentials. They will be used later to access our data base.

Image 27
 

Once you have completed the upload of dolibarr described in picture 23. Edit the index.php file.

We opened our favorite text editor and replace with the following code.

<?php header("Location: dolibarr/htdocs"); ?>

We make a copy of index.php in dolibarr folder and re-edit it and remove dolibarr/.

<?php header("Location: htdocs"); ?>

Image 28
 

What we have just done, serves don't shown the structure our folders and files of dolibarr from the web browser, with the index.php we force redirect to the home of Dolibarr.























Create an instance/domain

Submit Dolibarr files

Run Dolibarr install Wizard