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://email@example.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,[22.214.171.124]: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://firstname.lastname@example.org: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/
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