HOWTO: Install SugarCRM on Cloud PaaS: Red Hat OpenShift

bsoremsugar —  August 19, 2011 — 12 Comments

Editor’s Note: This article is the first in a series from Cedric Mourizard, one of the leading members of the Sugar Community and a consultant for SugarCRM Gold Partner Synolia. The series talks about deploying SugarCRM in several different Cloud-based PaaS ( Platform-as-a-Service  ) solutions. In this part of the series, he shows how to deploy SugarCRM in Red Hat OpenShift.

Red Hat has launched their cloud PaaS platform named OpenShift with three editions: Express, Flex and Power. Express edition is currently free and with the latest release you now have access to the MySQL database. As a result, it’s time to get started with Sugar on OpenShift Express!

Step 1: Create your account
Go to https://openshift.redhat.com/app/user/new/express and sign up for OpenShift.

Step 2: Set up your environnment
After your account has been created, follow the quickstart guide to set up your environment with:

  • RHC tools
  • GIT tools (very helpful to have installed in your environment if you are a contributor to the SugarCRM GitHub Project)

For example on the Debian platform, we use the following commands:

$ sudo gem install rhc
$ sudo aptitude install git

Step 3: Create your domain
The next step in deploying your Sugar application is to create a domain on the OpenShift platform:

$ rhc-create-domain -n YOUR_DOMAIN_NAME -l YOUR_EMAIL_ACCOUNT

Create a local config file: /home/cedric/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.

Password:
Generating OpenShift Express ssh key to /home/cedric/.ssh/libra_id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cedric/.ssh/libra_id_rsa.
Your public key has been saved in /home/cedric/.ssh/libra_id_rsa.pub.
The key fingerprint is:
4b:3f:ca:81:0e:2f:6e:f7:d5:6f:f9:7d:ae:90:44:41 cedric@debian6
The key's randomart image is:
+--[ RSA 2048]----+
|           .E    |
|             .   |
|            .    |
|           .     |
|        S   .    |
|       o o o .   |
|    . . o + +  . |
|    o+.. + . oo o|
|   o.oo.+    .o+=|
+-----------------+
Contacting https://openshift.redhat.com
Creation successful

You may now create an application.  Please make note of your local config file in /home/cedric/.openshift/express.conf which has been created and populated for you.

Step 3: Create your application
Now you can create your application with two services PHP…

$ rhc-create-app -a YOUR_APPLICATION_NAME -t php-5.3
Password:

Found a bug? Post to the forum and we'll get right on it.
    IRC: #openshift on freenode
    Forums: https://www.redhat.com/openshift/forums

Attempting to create remote application space: YOUR_APPLICATION_NAME
Contacting https://openshift.redhat.com

RESULT:
Successfully created application: YOUR_APPLICATION_NAME

Checking ~/.ssh/config
Contacting https://openshift.redhat.com
Found rhcloud.com in ~/.ssh/config... No need to adjust
Now your new domain name is being populated worldwide (this might take a minute)...
Pulling new repo down
Warning: Permanently added 'YOUR_APPLICATION_NAME-YOUR_DOMAIN_NAME.rhcloud.com,50.17.167.44' (RSA) to the list of known hosts.
Confirming application YOUR_APPLICATION_NAME is available
  Attempt # 1

Success!  Your application is now published here:

http://YOUR_APPLICATION_NAME-YOUR_DOMAIN_NAME.rhcloud.com/

The remote repository is located here:

    ssh://a82716d38dc5483385724f84f08dd3f3@YOUR_APPLICATION_NAME-YOUR_DOMAIN_NAME.rhcloud.com/~/git/YOUR_APPLICATION_NAME.git/

To make changes to your application, commit to YOUR_APPLICATION_NAME/.
Then run 'git push' to update your OpenShift Express space

and MySQL

$ rhc-ctl-app -a YOUR_APPLICATION_NAME -e add-mysql-5.1
Password:
Contacting https://openshift.redhat.com
Contacting https://openshift.redhat.com

RESULT:

Mysql 5.1 database added.  Please make note of these credentials:

   Root User: XXXXXXX
   Root Password: XXXXXXXXXXXXXXXXXXXXXXXXXX

Connection URL: mysql://127.1.46.1:3306/

Step 4: Add SugarCRM files
Change to your application directory root:

$ cd YOUR_APPLICATION_NAME/php/

Download and extract latest version of SugarCRM:

$ wget http://www.sugarforge.org/frs/download.php/8269/SugarCE-6.2.1.zip
$ unzip SugarCE-6.2.1.zip
$ rm -f SugarCE-6.2.1.zip
$ mv SugarCE-Full-6.2.1/.* .
$ mv SugarCE-Full-6.2.1/* .
$ rm -rf SugarCE-Full-6.2.1/

Add files to your local git repository:

$ git add -A
$ git commit -a -m "Initial commit"

Deploy your files to your your OpenShift Express space

$ git push

Step 5: Install SugarCRM
Go to http://YOUR_APPLICATION_NAME-YOUR_DOMAIN_NAME.rhcloud.com/ and follow the install process with MySQL credentials retrieved in step 3.

Conclusion
Now you could use your SugarCRM on Red Hat OpenShift Express platform with all advantages of cloud storage. Make attention on two points:

  • At this time php_imap module isn’t available on OpenShift Express by consequence you couldn’t use Webmail, campaign bounce inbox or mail group.
  • Each time you will make a git push you will reset all your file and potentially lost your modifications made online, we suggest to use rhc-snpashop command to retrieve your online file locally and merge them into your GIT repository before your git push

12 responses to HOWTO: Install SugarCRM on Cloud PaaS: Red Hat OpenShift

  1. 

    This is a great writeup, I’m happy to see SugarCRM is functioning on OpenShift.  If you’re interested, we’re putting together a series of community repos together so users can even more simply get their software running on OpenShift.  (Here’s an example of reviewboard – https://github.com/openshift/reviewboard-example)  Eventually we’re hoping to get all of these listed in a “supported community software” section or something.

    If you want, let me know how I can help mmcgrath redhat com (Cloud Architect, Red Hat)

    • 

      We have installed SugarCRM CE on OpenShift with an app name of crm. The instance is working, but we’ve made changes online, and of course a git push will erase those online changes. So, we’re trying to do a snapshot and then merge git before we push the new files. However, when I try to get a snapshot of the app, I get the error that the app is not found – but it’s clearly setup with rhc setup and git on my workstation.

      C:\Users\J\Projects\realCRM>rhc app snapshot crm
      DL is deprecated, please use Fiddle
      Application ‘crm’ not found.

      Can you tell me what I’m doing wrong, please?

  2. 

    Hi,

    I am unable to run the command mentioned in your steps for version 6.5.2:

    mv SugarCE-Full-6.5.2/.* . Gives me the following error:mv: cannot move `SugarCE-Full-6.5.2/.’ to `./.': Device or resource busymv: cannot move `SugarCE-Full-6.5.2/..’ to `./..': Device or resource busyAnyways I was able to Git it and upload on OpenShift but while doing the Database Configuration it is giving the following error

    1) The provided database host, username, and/or
    password is invalid, and a connection to the database could not be
    established. Please enter a valid host, username and password2) Unable to check database version.

    Username and password is correct as I am able to access My Sql using PHPAdmin with those credentials.

    HostName is Name of web server or machine (host) on which the database is located ( such as localhost or http://www.mydomain.com which has been set to my http://application-name-domainname.rhcloud.com/.

    Please help.

    Regards,

    Ganesh Bhat

  3. 

    Hi John,I just installed SugarCRM + PostgreSQL
    now the PHP IMAP module is supported by OpenShift. I just installed SugarCRM CE 6.5 + PostgreSQL 8.4 on OpenShift. The URL is http://sugarcrmpgsql-shiruslabs.rhcloud.com/

Trackbacks and Pingbacks:

  1. SugarCRM + PostgreSQL disponibile su OpenShift « Antonio Musarra's Blog - August 7, 2012

    [...] HOWTO: Install SugarCRM on Cloud PaaS: Red Hat OpenShift (developers.sugarcrm.com/) 0.000000 0.000000 Share this:Like this:Mi piaceBe the first to like this. [...]

  2. SugarCRM + PostgreSQL available OpenShift « Antonio Musarra's Blog - August 11, 2012

    [...] HOWTO: Install SugarCRM on Cloud PaaS: Red Hat OpenShift (developers.sugarcrm.com/) 0.000000 0.000000 Share this:Like this:Mi piaceBe the first to like this. [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s