SugarCRM Configuration in debian Sarge

What is SugarCRM ?

SugarCRM includes a sales, marketing, and service suite of CRM applications. Sugar.Sales includes account and contact management, opportunity management, activity tracking, charting, reporting, and email integration with MS Outlook. SugarCRM is easy to install and supports custom user interface templates that are optimized for speed.

SugarCRM v4.0.1 now available! A complete CRM and groupware system for businesses of all sizes. Functionality includes sales force automation, marketing campaigns, support cases, project mgmt, calendaring, documents and more. Built on PHP and MySQL.

Download SugarCRM

SugarCRM Documentation ,outlook plugin ,language packs and themes

Required packages for debian


Installing SugarCRM in Debian

There is no Debian package for Sugar, and so we need to download the source from the Sugar website to our home directory:

# cd ~

# wget

Become root, and then move Sugar to your web-root and extract the files:

# su

# cp /var/www

# cd /var/www

# unzip

Here we are using Apache virtual hosts to host lots of domains on a single server. We create a directory for each host under /var/www named, for example,

Assuming your are using Apache virtual hosts and a similar directory structure, rename the Sugar directory to match it's domain name. Here we use

# mv SugarSuite-Full-4.0.1

# rm

Note we have also removed the ZIP file.

By default on Debian Apache runs as www-user. Set ownership of the Sugar directory to the Apache user:

# chown -R www-data:www-data /var/www/

The Apache user requires write access to certain directories and the config file in order for the system to function properly. Set the permissions on these as follows:

# chmod -R 755 /var/www/
# chmod -R 775 /var/www/
# chmod -R 775 /var/www/
# chmod -R 775 /var/www/
# chmod -R 775 /var/www/
# chmod 774 /var/www/

Apache Configuration

Next we need to configure a virtual host for our Sugar domain in Apache.

Note our use of the AllowOverride directive, which is used to allow a .htaccess file in the Sugar root directory to affect web-server configuration:

# vi /etc/apache/conf.d/
<VirtualHost *>
ServerAdmin [email protected]
DocumentRoot /var/www/
<Directory /var/www/>
AllowOverride All

Once you have these pieces in place (and started), you need to edit the configuration file for apache to know about PHP4 and your server. To enable PHP4 uncomment or add the following line to /etc/apache2/apache2.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Once this is done make sure your server knows about the directory where you want to install the SugarCRM. Edit /etc/apache2/sites-enabled/000-default and change all occurances of /var/www with the directory you want to use (e.g. /web/sugarcrm).

Edit /etc/php4/apache2/php.ini and add the following two lines

And then restart Apache and test the website:

# /etc/init.d/apache reload may have noticed some warnings on Sugar's status check page. See below.

PHP tuning for apache

Increase PHP's maximum file upload size:

# cp /etc/php4/apache/php.ini /etc/php4/apache/php.ini.20060312

# ee /etc/php4/apache/php.ini

memory_limit = 50M

And restart Apache:

# /etc/init.d/apache restart

Extra Packages

Install some packages that Sugar can use:

# aptitude install catdoc xpdf-utils

MySQL Configuration

Sugar can help us setup the MySQL database if we provide it some credentials:

enter a database password for Sugars database

check Create database and Create user

uncheck Database account above is a privileged user

enter the root Mysql user username and password

and then click next

Basic Configuration

Enter an admin password for Sugar's interface

Check for errors

check your config file contains 'installer_locked' => true

and click next

Now login and explore the interface. Come back to finalise a few points later.


Sugar can perform actions according to a schedule, but we need to configure the scheduler. Add a cron job to the Apache user's crontab:

# crontab -e -u www-data

* * * * * wget --quiet --non-verbose > /dev/null 2>&1
The scheduler should now function.

As sugarcrm contains sensible data it is mandatory to create backups, especially as we don't trust mysql that much. Therefore I created the following backup script in /web/sugarcrm/etc/

datum=$(date +%Y%m%d)
/usr/bin/mysqldump sugarcrm --complete-insert -u sugarcrm --flush-logs --opt --add-locks >$file /bin/gzip $file