How to Install SugarCRM Community Edition on an Ubuntu 14.x

  Sugarcrm, UBUNTU

Download the latest version of SugarCRM Community Edition available at http://sourceforge.net/projects/sugarcrm/files/ to the ‘/opt’ directory on the server. Then, extract it and move the SugarCRM files and directories to the ‘/var/www/html/sugar’ directory. At the time of writing this tutorial, the latest stable version of SugarCRM Community Edition is 6.5.20.

cd /opt/
wget http://sourceforge.net/projects/sugarcrm/files/latest/download -O SugarCE-6.5.20.zip
unzip SugarCE-6.5.20.zip
mv SugarCE-Full-6.5.20 /var/www/html/sugar

SugarCRM Community Edition requires:

  • PHP with bcmath, cURL, GD graphics library, hash, IMAP, JSON, mbstring, MySQLi, openSSL, SimpleXML, ZIP and ZLIB PHP extensions enabled.
  • Apache Web Server >= 2.x+
  • MySQL >= 5.x installed on your Linux VPS.

Update your OS package lists and install the software updates using the following commands:

apt-get update
apt-get upgrade

Install PHP and required PHP modules:

apt-get install php5 php5-cli php5-common php5-dev php5-mysql php5-curl php5-gd php-pear php5-imap php5-mcrypt php5-xmlrpc php5-xsl

In order to improve performance, it is recommended to have JSMin PHP extension installed on your server. The JSMin PHP extension can be installed using the pecl command:

pecl install jsmin

Edit the php.ini configuration file and add ‘extension=jsmin.so’ to it:

vi /etc/php5/apache2/php.ini
extension=jsmin.so

Also, add/modify the following settings:

post_max_size = 32M
upload_max_filesize = 32M
memory_limit = 768M

InboundEmail and Campaigns (Email) require the IMAP libraries, so enable the IMAP module:

sudo php5enmod imap

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘sugar.conf’:

touch /etc/apache2/sites-available/sugar.conf
ln -s /etc/apache2/sites-available/sugar.conf /etc/apache2/sites-enabled/sugar.conf
vi /etc/apache2/sites-available/sugar.conf

then, add the following lines:

<VirtualHost *:80>
   ServerAdmin admin@your-domain.com
   DocumentRoot /var/www/html/sugar/
   ServerName your-domain.com
   ServerAlias www.your-domain.com
   <Directory /var/www/html/sugar/>
      Options FollowSymLinks
      AllowOverride All
   </Directory>
   ErrorLog /var/log/apache2/your-domain.com-error_log
   CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Restart the Apache web server for the changes to take effect:

service apache2 restart

The following files and directories inside the ‘/var/www/html/sugar/’ directory need to be writable from your web server:

'config.php' 
'config_override.php'
'sugarcrm.log'
'cache' and all subdirectories and files
'custom' and all subdirectories and files
'data' and all subdirectories and files
'modules' and all subdirectories and files

This can easily be accomplished by executing the following command:

chown www-data:www-data -R /var/www/html/sugar/

Create a new MySQL database named ‘sugarcrm’ on your server:

mysql -u root -p
mysql> CREATE DATABASE sugarcrm;
mysql> CREATE USER sugar@localhost;
mysql> SET PASSWORD FOR 'sugar'@'localhost' = PASSWORD("sugar-password");
mysql> GRANT ALL PRIVILEGES ON sugarcrm.* TO 'sugar'@'localhost' IDENTIFIED BY 'sugar-password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

Do not forget to change ‘sugar-password’ with a strong password for your ‘sugar’ MySQL user.

Open http://your-domain.com in your favorite web browser and follow the easy instructions

LEAVE A COMMENT