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,22.214.171.124' (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
$ 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.
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