Line 1:
Line 1:
+
<!-- BEGIN origin interlang links -->
+
<!-- You can edit this section but do NOT remove these comments
+
Links below will be automatically replicated on translated pages by PolyglotBot -->
+
[[es:Cloud_con_Redhat_OpenShift_Flex]]
+
<!-- END interlang links -->
+
[[Category:Admin]]
[[Category:Admin]]
+
[[Category:Admin_en]]
[[Category:Cloud]]
[[Category:Cloud]]
{{TemplateDocUser}}
{{TemplateDocUser}}
−
{{ToComplete}}
This page is a tutorial to explain how to install Dolibarr ERP-CRM on the Redhat OpenShift Flex Platform www.openshift.com
This page is a tutorial to explain how to install Dolibarr ERP-CRM on the Redhat OpenShift Flex Platform www.openshift.com
−
Image1<br />
+
''click twice on image to enlarge''
+
+
Image 1<br />
[[File:Url_openshift.JPG]]
[[File:Url_openshift.JPG]]
−
A little about OpenShift.
−
OpenShift Platform as a Service
+
= A little about OpenShift =
−
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 Platform as a Service'''
+
+
OpenShift is Red Hat's Platform-as-a-Service ([http://en.wikipedia.org/wiki/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.
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.
Openshfit works with Gears and Cartridges, which are terms with which we have to familiarize ourselves.
+
'''What's a Gear?'''<br />
'''What's a Gear?'''<br />
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.
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.
If an application needs more resources, it can be configured to automatically use more gears.
+
'''How Do Gears Work?'''<br />
'''How Do Gears Work?'''<br />
−
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.
+
Let's look at an example Drupal-based app running on OpenShift. We can estimate the needs of the app at different stages.
−
15 pages/second
+
−
Hundreds of articles
+
*15 pages/second
−
~ 50k visitors per month
+
*Hundreds of articles
−
3 Small Gears
+
*~ 50k visitors per month
−
Free plan
+
*3 Small Gears
+
*Free plan
As we see, a free plan, it may be sufficient for a small or medium company.
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.
For larger companies, you can switch to the next plan.
+
In OpenShift, we have two possibilities, to launch Dolibarr.
In OpenShift, we have two possibilities, to launch Dolibarr.
−
1 -. As developers, it gives us the ability to extend or create your own modules.<br />
+
1 -. To extend or create your own modules.<br />
−
2 -. As entrepreneurs, it gives us the opportunity to put into production our Dolibarr.
+
2 -. To put in production our Dolibarr.
−
Advantages offered OpenShift.
−
It is a secure site, which is accessed through SSH.
+
'''Advantages offered OpenShift'''
−
It is scalable
+
It is a secure site, which is accessed through [http://en.wikipedia.org/wiki/Secure_Shell SSH].
+
+
It is scalable<br />
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.
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.
+
Gives us total control on our database for us to connect remotely to via a GUI client.
−
If opt for MySql, we feature the InnoDB engine, essential for transactions.
+
If we opt for MySql, we feature the [http://en.wikipedia.org/wiki/InnoDB 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.
+
It gives us the possibility to share [http://en.wikipedia.org/wiki/Transport_Layer_Security SSL] Certificates of RedHat or customize our own SSL, if you have one. Essential to send our data of login or bank transfers, encrypted and secure.
= Create an account =
= Create an account =
−
+
Click in SIGN UP
−
Click in SING UP
Image 2<br />
Image 2<br />
[[File:Sing_up.JPG|500px]]
[[File:Sing_up.JPG|500px]]
−
Fill our data to create an account.
+
Fill your data to create an account.
Click in Sign Up
Click in Sign Up
+
Image 3<br />
Image 3<br />
Line 68:
Line 84:
They will send an email to your email account to confirm. Click in Verify your Account.
They will send an email to your email account to confirm. Click in Verify your Account.
+
= Create an instance/domain =
−
= Create an instance/domain =
+
== Part 1 - Create instance ==
Click LOG IN back and show us the initial aspect of our console applications.
Click LOG IN back and show us the initial aspect of our console applications.
Line 77:
Line 94:
Click in Create your first application now
Click in Create your first application now
+
Choose a web programming cartridge
Choose a web programming cartridge
Line 84:
Line 102:
1. Choose a type of application
1. Choose a type of application
+
Image 6<br />
Image 6<br />
Line 90:
Line 109:
2. Configure the application.
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.
+
It is important to define the domain name, for this tutorial 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.
Also, we will have to report, if we have an external git repository with our code.
+
Here comes the fun part.
Here comes the fun part.
Line 112:
Line 132:
Note. - With PuTTY, we could resolve more explicit requirements to control our Gears with command line.
Note. - With PuTTY, we could resolve more explicit requirements to control our Gears with command line.
+
Click on the link Web load Balancer.
Click on the link Web load Balancer.
Line 126:
Line 147:
−
== second part of our tutorial ==
+
== Part 2 - Setup admin tools ==
So far so good. Now to the second part of our tutorial.
So far so good. Now to the second part of our tutorial.
Line 133:
Line 154:
I chose the easiest way I've intuitive, which is the second option for this tutorial.
I chose the easiest way I've intuitive, which is the second option for this tutorial.
+
Hands to work.
Hands to work.
−
We need a SSH / FTP client like WinSCP and PuTTY.
+
We need a SSH / FTP client like [http://sourceforge.net/projects/winscp WinSCP] and PuTTY.
We download and install.
We download and install.
Line 145:
Line 167:
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.
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.
+
+
Double Click in puttygen.
image 11<br />
image 11<br />
−
[[File:Puttygen_initial.JPG|300px]]
+
[[File:Puttygen_initial.JPG|400px]]
We leave the default values, SSH-2 RSA, and the number of bits in 2048.
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.
With these values and will have a key, heavily encrypted.
+
+
Click in Generate
Image 12<br />
Image 12<br />
−
[[File:Puttygen_generating.JPG|300px]]
+
[[File:Puttygen_generating.JPG|400px]]
To generate our key, we must move the mouse pointer constantly in the blank space of program.
To generate our key, we must move the mouse pointer constantly in the blank space of program.
+
Image 13<br />
Image 13<br />
−
[[File:Puttygen_generate_end.JPG|300px]]
+
[[File:Puttygen_generate_end.JPG|400px]]
Once our key generation is complete, we will add a passphrase.
Once our key generation is complete, we will add a passphrase.
Line 169:
Line 195:
We mark the generated code in the text area and copy it, then we go to our OpenShift console.
We mark the generated code in the text area and copy it, then we go to our OpenShift console.
+
Image 14<br />
Image 14<br />
Line 174:
Line 201:
Paste the code into Paste the contents of your public key file (. Pub) and click Save.
Paste the code into Paste the contents of your public key file (. Pub) and click Save.
+
Image 15<br />
Image 15<br />
Line 181:
Line 209:
Now we go to the Applications tab in our console OpenShift.
Now we go to the Applications tab in our console OpenShift.
+
Click on our application startdolibarr.
Click on our application startdolibarr.
Line 187:
Line 216:
Image 16<br />
Image 16<br />
−
[[File:SourceCode_and_Remote_Access.JPG500px]]
+
[[File:SourceCode_and_Remote_Access.JPG|500px]]
Copy the code ssh 53641a41e0b8cdf5ec000b76@startdolibarr-sdme.rhcloud.com
Copy the code ssh 53641a41e0b8cdf5ec000b76@startdolibarr-sdme.rhcloud.com
+
We opened our WinSCP.
We opened our WinSCP.
Image 17<br />
Image 17<br />
−
[[File:Login_WinSCP.JPG]]
+
[[File:Login_WinSCP.JPG|500px]]
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.
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.
Line 201:
Line 231:
Click in Advanced.
Click in Advanced.
+
Image 18<br />
Image 18<br />
−
[[File:Login_WinSCP_SSH_private_Key.JPG]]
+
[[File:Login_WinSCP_SSH_private_Key.JPG|500px]]
In Private key file: select your private key rsa.ppk, click OK, click save, and click Login.
In Private key file: select your private key rsa.ppk, click OK, click save, and click Login.
+
Image 19<br />
Image 19<br />
−
[[File:Warning_connect_to_WinSCP.JPG]]
+
[[File:Warning_connect_to_WinSCP.JPG|500px]]
When we leave this nice window click Yes.
When we leave this nice window click Yes.
+
Image 20<br />
Image 20<br />
Line 216:
Line 249:
Here we place our passphrase and click OK.
Here we place our passphrase and click OK.
+
Image 21<br />
Image 21<br />
Line 223:
Line 257:
On the left is our local space and right remote.
On the left is our local space and right remote.
+
= Submit Dolibarr files =
= Submit Dolibarr files =
Line 230:
Line 265:
We went down the generic version of Doibarr.
We went down the generic version of Doibarr.
+
Image 23<br />
Image 23<br />
Line 244:
Line 280:
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
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<br />
Image 25<br />
Line 250:
Line 287:
Click in add Cartridge.
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.
+
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<br />
Image 26<br />
Line 256:
Line 294:
Copy the MySQL access credentials. They will be used later to access our data base.
Copy the MySQL access credentials. They will be used later to access our data base.
+
Image 27<br />
Image 27<br />
−
[[File:Delete_Index_php.JPG]]
+
[[File:Delete_Index_php.JPG|500px]]
Once you have completed the upload of dolibarr described in picture 23. Edit the index.php file.
Once you have completed the upload of dolibarr described in picture 23. Edit the index.php file.
Line 273:
Line 312:
header("Location: htdocs");<br />
header("Location: htdocs");<br />
?>
?>
+
Image 28<br />
Image 28<br />
Line 283:
Line 323:
We opened our text editor again and add the following.
We opened our text editor again and add the following.
−
RewriteEngine on<br />
+
*RewriteEngine on<br />
−
RewriteCond %{HTTP:X-Forwarded-Proto} !https<br />
+
*RewriteCond %{HTTP:X-Forwarded-Proto} !https<br />
−
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
+
*RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Save with the name .htaccess right next to our dolibarr folder and index.php.
Save with the name .htaccess right next to our dolibarr folder and index.php.
As shown in the following image.
As shown in the following image.
+
Image 29<br />
Image 29<br />
Line 295:
Line 336:
[[File:HttpAndhttps.JPG]]
[[File:HttpAndhttps.JPG]]
+
Image 30<br />
Image 30<br />
Line 310:
Line 352:
We select from the drop down, Default language to use (language code):, the appropriate language and click Next step.
We select from the drop down, Default language to use (language code):, the appropriate language and click Next step.
+
Image 32<br />
Image 32<br />
Line 318:
Line 361:
Image 33<br />
Image 33<br />
−
[[File:Environment_Variables_conextion_MySQL.JPG]]
+
[[File:Environment_Variables_conextion_MySQL.JPG|500px]]
We review the image 26, when we created the MySQL Cartridge.
We review the image 26, when we created the MySQL Cartridge.
Line 324:
Line 367:
And we focus on the lines.
And we focus on the lines.
−
Root User: adminCRERXju<br />
+
*Root User: adminCRERXju<br />
−
Root Password: tccRTZ8-xCnK<br />
+
*Root Password: tccRTZ8-xCnK<br />
−
Database Name: startdolibarr<br />
+
*Database Name: startdolibarr<br />
−
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
+
*Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
Line 333:
Line 376:
Click the right mouse button on OPENSHIFT_MYSQL_DB_HOST, click on edit and show us the value of the variable, copy and paste into the Server field as shown in the image below. We do the same for OPENSHIFT_MYSQL_DB_PORT variable and paste its value in the Port field.
Click the right mouse button on OPENSHIFT_MYSQL_DB_HOST, click on edit and show us the value of the variable, copy and paste into the Server field as shown in the image below. We do the same for OPENSHIFT_MYSQL_DB_PORT variable and paste its value in the Port field.
−
Line 344:
Line 386:
Click Next Step and displays the following window.
Click Next Step and displays the following window.
+
Image 35<br />
Image 35<br />
Line 351:
Line 394:
Click Next Step and start creating tables in the database, necessary for the work of Dolibarr.
Click Next Step and start creating tables in the database, necessary for the work of Dolibarr.
+
Image 36<br />
Image 36<br />
Line 358:
Line 402:
Click in Next step.
Click in Next step.
+
Image 37<br />
Image 37<br />
Line 365:
Line 410:
Click in Next step.
Click in Next step.
+
Image 38<br />
Image 38<br />
Line 378:
Line 424:
−
== Connection remote MySQL ==
+
= Appendix: Connection remote MySQL =
As a final step, we will see the connection from a local client database, to our remote MySQL.
As a final step, we will see the connection from a local client database, to our remote MySQL.
−
For this example I will use HeidiSQL, which serves both MySQL or PostgreSQL database and is Free.
+
For this example I will use [http://sourceforge.net/projects/heidisql HeidiSQL], which serves both MySQL or PostgreSQL database and is Free.
Open HeidiSQL.
Open HeidiSQL.
The first thing to do is select MySQL (SSH tunnel) Network type drop down, in so doing, HeidiSQL adds a new tab called SSH tunnel, as shown in the image below.
The first thing to do is select MySQL (SSH tunnel) Network type drop down, in so doing, HeidiSQL adds a new tab called SSH tunnel, as shown in the image below.
+
Image 41<br />
Image 41<br />
Line 395:
Line 442:
We return to the Settings tab.
We return to the Settings tab.
+
+
Image 42<br />
[[File:Settings_heidisql.JPG|500px]]
[[File:Settings_heidisql.JPG|500px]]
−
We fill the fields with the credentials of the database, select the database, click in Save and click in Open to test the connection.
+
We obtain the hostname and port of MySQL to connect to Dolibarr database. Top image 33.
+
Fill the fields with the credentials of the database, select the database, click in Save and click in Open to test the connection.
+
Image 43<br />
[[File:HeidiSQL_has_established_connection.JPG|500px]]
[[File:HeidiSQL_has_established_connection.JPG|500px]]
−
And with that we end this tutorial.
+
== Addendum ==
+
=== Connection to MySQL Gear ===
+
You remember when we obtained the hostname and port of MySQL to connect to Dolibarr database. Top image 33.
+
Image 44<br />
+
[[File:WinSCP_connect_MySQL_Gear.JPG|500px]]
+
The first part of the Hostname: is also the Username:
+
5364c670e0b8cd09f500036d-sdme.rhcloud.com click in Advanced and verify that everything be as the image 18.
+
Click in Save and click in Login.
+
With open WinSCP, go to the Options menu --> preferences --> Integration --> Applications as shown in the image below.
+
In the PuTTY/terminal client path: field select the path where we have the putty.exe and mark the three checkboxes.
+
Image 45<br />
+
[[File:Preferences_winscp_run_putty.JPG|500px]]
+
Each time you start in with WinSCP session also will start session in PuTTY. As seen in the image below.
+
Image 46<br />
+
[[File:Initialize_session_winscp_with_putty.JPG|500px]]
+
Having PuTTY open and connected to the same session, allow us to execute command line statements to stop or start the MySQL server or Gear.
+
Note -. Also in the remote part of WinSCP, we can navigate to folders as
+
/var/lib/openshift/5364c670e0b8cd09f500036d/mysql/data/startdolibarr where this physically our database or we can go to /var/lib/openshift/5364c670e0b8cd09f500036d/app-root/logs to see MySQL logs.
+
If we write help in the PuTTY window, will show some important commands.
+
Among the common commands are:
+
ctl_app<br />
+
Control your application (MySQL)
+
*ctl_app start
+
*ctl_app stop
+
*ctl_app restart
+
*ctl_app status
+
ctl_all<br />
+
Similar to ctl_app but we can control the whole Gear.
+
*ctl_all start
+
*ctl_all stop
+
*ctl_all restart
+
*ctl_all status
+
Cited here www.openshift.com/developers/remote-access where we find most useful commands.
−
+
And with that we end this tutorial.
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
= Submit Dolibarr files =
−
−
−
= Run Dolibarr install Wizard =