Install SugarCRM on Cloud PaaS: DotCloud

bsoremsugar —  August 15, 2011 — 6 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 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 DotCloud.

DotCloud is a platform-as-a-service we give your the capability to deploy and scale your application in the cloud. You could find more information here. It’s possible to host your SugarCRM on free version of DotCloud because that require only two services (PHP and MySQL)

Step 1: Create your account
Go to https://www.dotcloud.com/accounts/register/ and sign up for DotCloud.

Step 2: Set up your environnment
After than your account has been created, you could follow the first steps to set up your environment for dotcloud.

Step 3: Create your application
First, create the application:

$ dotcloud create YOUR_APPLICATION_NAME

Second, create the dotcloud.yml file wich defines services available for your application:

$ vi dotcloud.yml
www:
  type: php
db:
  type: mysql

Third, push this file on your dotcloud space to initialize it:

$ dotcloud push YOUR_APPLICATION_NAME .
 upload /home/cedric/dotcloud ssh://dotcloud@uploader.dotcloud.com:21122/YOUR_APPLICATION_NAME
# rsync
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '[uploader.dotcloud.com]:21122,[184.73.14.49]:21122' (RSA) to the list of known hosts.
building file list ... done
./
dotcloud.yml

sent 147 bytes  received 34 bytes  51.71 bytes/sec
total size is 35  speedup is 0.19
Deployment for "YOUR_APPLICATION_NAME" triggered. Will be available in a few seconds.
2011-08-10 16:43:44 [api] Deploy YOUR_APPLICATION_NAME scheduled for revision=latest
2011-08-10 16:43:45 [api] Waiting for the build. (It may take a few minutes)
2011-08-10 16:43:45 [www.0] Deploying...
2011-08-10 16:43:45 [db.0] Deploying...
2011-08-10 16:44:01 [www.0] Service booted
2011-08-10 16:44:06 [db.0] Service booted
2011-08-10 16:44:07 [api] All the services are ready. Beginning the build.
2011-08-10 16:44:08 [www.0] The build started
2011-08-10 16:44:08 [db.0] The build started
2011-08-10 16:44:08 [db.0] This service type does not support build method, ignoring...
2011-08-10 16:44:08 [db.0] The build finished successfully
2011-08-10 16:44:08 [www.0] Fetched code revision rsync-1312994609.96
2011-08-10 16:44:09 [www.0] Updating channel "doc.php.net"
2011-08-10 16:44:09 [www.0] Update of Channel "doc.php.net" succeeded
2011-08-10 16:44:09 [www.0] Updating channel "pear.php.net"
2011-08-10 16:44:10 [www.0] Channel "pear.php.net" is up to date
2011-08-10 16:44:10 [www.0] Updating channel "pecl.php.net"
2011-08-10 16:44:10 [www.0] Update of Channel "pecl.php.net" succeeded
2011-08-10 16:44:12 [www.0] Reloading nginx configuration: nginx.
2011-08-10 16:44:15 [www.0] php5-fpm: stopped
2011-08-10 16:44:15 [www.0] php5-fpm: started
2011-08-10 16:44:15 [www.0] The build finished successfully
2011-08-10 16:44:15 [api] Deploy finished

Deployment finished. Your application is available at the following URLs
www: http://YOUR_DEDICATED_URL.dotcloud.com/

Fourthly, retrieve your database information

$ dotcloud info YOUR_APPLICATION_NAME.db
cluster: wolverine
config:
    mysql_password: YOUR_DATABASE_PASSWORD
created_at: 1312994625.530937
ports:
-   name: ssh
    url: ssh://mysql@8246016a.dotcloud.com:9855
-   name: mysql
    url: mysql://root:YOUR_DATABASE_PASSWORD@8246016a.dotcloud.com:9856
state: running
type: mysql

Step 3: Add SugarCRM files
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/

Deploy your files to your your OpenCloud space

$ dotcloud push YOUR_APPLICATION_NAME .

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 in previous step withour forgot to specify the complete host name with port number (8246016a.dotcloud.com:9856 in our example).
If you forgot your URL, at each time your could use this command to retrieve it:

$ dotcloud url YOUR_APPLICATION_NAME
www: http://YOUR_DEDICATED_URL.dotcloud.com/

Conclusion
As of Red Hat OpenShift Express & PHP Fog platforms, make attention on three points:

  • At this time php_imap module isn’t available on DotCloud by consequence you couldn’t use Webmail, campaign bounce inbox or mail group.
  • Each time you will make a dotcloud push you will reset all your file and potentially lost your modifications made online, we suggest to retrieve your online file locally and merge them before your dotcloud push
  • DotCloud use Nginx web server, perhaps you should to adapt some .htaccess rules to increase your hosting. see here

But the main advantage of DotCloud is his simple way to scale your space and to add very easily a ton of additionnal services.

6 responses to Install SugarCRM on Cloud PaaS: DotCloud

  1. 

    Great article. I followed your article step by step. However, at the last step in the process of the install, it takes forever and then I get a 504 Gateway Time-out error. Any ideas of what I can do to avoid this?

    Also, I did contact dotcloud about the php_imap extension. They already have it in the pipeline for the production service and said it’s definitely on it’s way.

    • 
      Jérôme Petazzoni August 16, 2011 at 6:25 am

      Hi Scott,

      DotCloud is constantly scaling up its cluster, and particularly the API “control plane”. The 504 error that you spotted was harmless — it only reflected that the CLI was unable to retrieve the end of the build log. The application was still deploying in the background. While we have fixed most of those errors, when in doubt, you can repeat the command without risk.

      • 

        Turns out I was wrong, sorry — the 504 error appears when you try to load the sample data. Our servers are configured with rather short timeouts. Since loading the sample data takes some time, the script is interrupted before it completes. Installing without the sample data works like a charm.

        • 
          Cedric Mourizard August 16, 2011 at 10:30 am

          Hi Scoot and Jérôme, I think the 504 error is a temporary error during the replication time. Just wainting some minutes and try to launch index.php file in your URL instead of install.php

  2. 
    Jérôme Petazzoni August 16, 2011 at 6:28 am

    Hi John and Cedric,

    I wonder if it would be difficult (or even recommended?) to generate SugarCRM MySQL configuration.
    Since DotCloud exposes the database credentials in a JSON file, it might allow an even smoother installation, bypassing the install wizard.
    Of course, if the install wizard is also performing some extra steps (like preloading a SQL dump and creating auxiliary files), things might be more complex…

    • 
      Cedric Mourizard August 16, 2011 at 10:33 am

       I Jerome,

      In fact they are 2 possibilities :
      1. Install your SugarCRM locally and after put-it on DotCloud in this case your solution is the best solution
      2. Install your SugarCRM directly on DotCloud and in this case during install process SugarCRM create database, create table and add some files (cache files, customization files, etc)

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