SugarCRM is a Customer Relationship Management which can be easily installed and configured on top of LAMP stack. Written in PHP, SugarCRM comes with three editions: Community Edition (free), Professional Edition and Enterprise Edition.
Install SugarCRM CMS on Linux
This tutorial will guide you on you how to install SugarCRM Community Edition on a RedHat and Debian based systems such as CentOS, Fedora, Scientific Linux, Ubuntu, etc.
Step 1: Installing LAMP Stack in Linux
1. As I said, SugarCRM requires LAMP stack environment, and to install LAMP stack on your respective Linux distributions, use following commands.
-------------------- On RHEL/CentOS 7 --------------------
# yum install httpd mariadb-server mariadb php php-mysql php-pdo php-gd php-mbstring php-imap
-------------------- On RHEL/CentOS 6 and Fedora --------------------
# yum install httpd mysql mysql-server php php-mysql php-pdo php-gd php-mbstring php-imap
-------------------- On Fedora 23+ Version --------------------
# dnf instll httpd mariadb-server mariadb php php-mysql php-pdo php-gd php-mbstring php-imap
-------------------- On Debian 8/7 and Ubuntu 15.10/15.04 --------------------
# apt-get install apache2 mariadb-server mariadb-client php5 php5-mysql libapache2-mod-php5 php5-imap
-------------------- On Debian 6 and Ubuntu 14.10/14.04 --------------------
# apt-get instll apache2 mysql-client mysql-server php5 php5-mysql libapache2-mod-php5
2. After LAMP stack installed, next start MySQL service and use mysql_secure_installation script to secure database (add new root password, disable remote root login, delete test database and delete anonymous users).
# systemctl start mariadb [On SystemD]
# service mysqld start [On SysVinit]
3. Before proceeding with SugarCRM installation first we need to create MySQL database. Login to MySQL database and run the below commands to create the database and the user for SugarCRM installation.
# mysql -u root -p
create database sugarcms;
grant all privileges on sugarcms.* to 'tecmint'@'localhost' identified by 'password';
Create SugarCMS MySQL Database
Note: For your safety replace the database name, the user and the password with your own.
4. Issue getenforce command to check if Selinux in enabled on our machine. In case the policy is set to Enforced disable it by issuing the below commands:
# setenforce 0
Check SELinux Status
Important: To completely disable Selinux, open /etc/selinux/config file with a text editor and set the line SELINUX to disabled.
Disable SELinux Mode
To over-ride Selinux policy run the below command:
# chcon -R -t httpd_sys_content_rw_t /var/www/html/
5. Next, assure that wget (file downloader for linux) and unzip system utilities are installed on your machine.
# yum install wget unzip [On RedHat systems]
# apt-get install wget unzip [On Debian systems]
6. On the last step open /etc/php.ini or /etc/php5/cli/php.ini configuration file and make the following changes:
- Rise the upload_max_filesize to minimum 7MB
- Set the date.timezone variable to your server physical timezone.
upload_max_filesize = 7M
date.timezone = Europe/Bucharest
In order to apply changes restart Apache daemon by issuing the following command:
------------ On SystemD Machines ------------
# service httpd restart
# service apache2 restart
------------ On SysVinit Machines ------------
# systemctl restart httpd.service
# systemctl restart apache2.service
Step 2: Installing SugarCRM Customer Relationship Management Tool
7. Now let’s install SugarCTM. Go to SugarCRM download page and grab the latest version on your system by issuing the following command:
# wget http://liquidtelecom.dl.sourceforge.net/project/sugarcrm/1%20-%20SugarCRM%206.5.X/SugarCommunityEdition-6.5.X/SugarCE-6.5.22.zip
8. After the download finishes, use unzip command to extract the archive and copy the configuration files to your webserver document root. List the files from /var/www/html or /var/www directory by running the below commands:
# unzip SugarCE-6.5.22.zip
# cp -rf SugarCE-Full-6.5.22/* /var/www/html/
# ls /var/www/html/
acceptDecline.php image.php removeme.php
cache include robots.txt
campaign_tracker.php index.php run_job.php
campaign_trackerv2.php install service
config_override.php install.php soap
config.php json_server.php soap.php
cron.php jssource sugarcrm.log
crossdomain.xml leadCapture.php SugarSecurity.php
custom LICENSE sugar_version.json
data LICENSE.txt sugar_version.php
dictionary.php log4php themes
download.php log_file_restricted.html TreeData.php
emailmandelivery.php maintenance.php upload
examples metadata vcal_server.php
export.php metagen.php vCard.php
files.md5 ModuleInstall WebToLeadCapture.php
HandleAjaxCall.php modules XTemplate
ical_server.php pdf.php Zend
9. Next, change directory to /var/www/html and modify the permissions recursively for the below directories and files in order to grant apache with write permissions:
# cd /var/www/html/
# chmod -R 775 custom/ cache/ modules/ upload/
# chgrp -R apache custom/ cache/ modules/ upload/
# chmod 775 config.php config_override.php
# chgrp apache config.php config_override.php
Also, create an htaccess file on webroot directory and grant Apache with write permissions to this file.
# touch .htaccess
# chmod 775 .htaccess
# chgrp apache .htaccess
10. On the next step open a browser from a remote location in your LAN and navigate to the IP Address of the machine running LAMP (or domain), choose the installation language and hit Next button.
11. After a series of system checks hit Next to continue.
SugarCRM System Requirement Checks
12. On the next screen accept the license and hit Next button again.
Accept SugarCRM License Agreement
13. After a series of environment checks the installer will redirect to SugarCRM Installation Options. Here choose Custom Install and click Next button to proceed further.
Select SugarCRM Installation Type
14. Choose MySQL as internal database for SugarCRM and hit Next button again.
Select SugarCRM Database Type
15. Once the database configuration screen appears proceed to MySQL database setup. Here fill the fields with the values created earlier for SugarCRM MySQL database and hit Next when finished:
Database Name: sugarcms
Host name: localhost
Database Administrator Username: tecmint
Database Admin Password: password
Sugar Database Username: Same as Admin User
Populate Database with Demo Data: no
SugarCRM Database Configuration
If the database is already created a notification will prompt you to verify DB Credentials. Hit Accept button to proceed further.
16. On the next screen the installer you ask you the URL of Sugar instance and a name for the system. Leave the URL value as default and choose a descriptive name for SugarCRM system. Also, enter a Admin username and password for SugarCRM.
SugarCRM Site Configuration
17. On the next screen, Site Security, uncheck all options and press Next to continue.
SugarCRM Site Security
17. Finally, review SugarCRM configurations and confirm settings by pressing the Install button.
Confirm SugarCRM Settings
18. After the installation finishes, hit Next button to continue. You can also upload a Language Pack for SugarCRM if that’s the case.
SugarCRM Configuration Setup
19. On the next screen you can choose to register the software. If that’s the case, fill the required fields accordingly and hit Submit. When finished hit Next button again and the Login main window should appear.
20. Login with the credentials created earlier and proceed by personalizing SugarCMS with a logo, locale settings, mail settings and your personal information.
Step 3: Secure SugarCRM
21. After the configuration process, enter command line issue the following commands in order to revert changes made to SugarCRM installation files. Also remove the installation directory by issuing the following commands.
# cd /var/www/html/
# chmod 755 .htaccess config.php config_override.php
# rm -rf install/ install.php
Finally add the following cronjob for SugarCMS on your machine by running crontab -e command:
* * * * * cd /var/www/html/; php -f cron.php > /dev/null 2>&1
Congratulations! SugarCRM is now installed on your system.