Tuesday, October 17, 2017

How to Install SuiteCRM on CentOS 7



SuiteCRM is a fork of the popular customer relationship management software SugarCRM. It is a free and open source alternative to SugarCRM. It is written in PHP and uses MySQL / MariaDB to store its data.
Requirements
SuiteCRM does not have a minimum hardware requirement, the requirements increases as the users of the application increases. For optimal performance, you should use a server with 1GB RAM. To follow this tutorial, you will need a server with minimal CentOS 7 installed. All the required dependencies will be installed throughout the tutorial. You will also need root access or sudo access on your server. If you are logged in as non root user, run sudo -i to switch to root user.
Installing SuiteCRM
Before installing any package it is recommended that you update the packages and repository using the following command.
yum -y update 
To install SuiteCRM, you will need to install a web server, PHP and database server. In this tutorial, we will be installing the Apache web server with PHP 7.0 and MariaDB as a database server.
To install Apache web server run the following command.
yum -y install httpd 
To start the Apache web server and enable it to start at boot time, run the following command.
systemctl start httpd systemctl enable httpd 
Although SuiteCRM can be installed on earlier versions of PHP, we will be installing it on the latest version of PHP which is PHP 7.0. The default YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP greater than 5.5. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.
yum -y install epel-release yum -y update yum clean all
Now install Webtatic repository using the following commands.
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum -y update
To install PHP 7.0 and all the required PHP modules, run the following command.
yum -y install php70w php70w-mysql php70w-xml php70w-json php70w-gd php70w-mbstring php70w-zip php70w-imap php70w-pcre php70w-zlib php70w-curl
Once PHP is installed, you will need to configure few thing in php.ini configuration.
Open /etc/php.ini using your favorite editor.
nano /etc/php.ini
If you do not have nano installed, you can install it using
yum -y install nano.
Scroll down to find the following lines.
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M
Although 128MB for PHP is enough for SuiteCRM, but you may increase it to higher amounts for faster processing of the application.
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M
Change the max upload to at least 20 MB. It should look like as shown below.
upload_max_filesize = 20M
Once done, restart Apache web server using the following command.
systemctl restart httpd
Now install MariaDB database server using the following command.
yum -y install mariadb mariadb-server
Start MariaDB and enable it to start at boot time using the following commands.
systemctl start mariadb systemctl enable mariadb
Now run the following command to secure your MariaDB installation.
mysql_secure_installation
It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. It will ask you if you want to set a root password for your MariaDB installation, choose y and set a strong password for the installation. It will further ask you for removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer yes to all the questions.
Now you will need to create a database with database user to store SuiteCRM data. To create a database we will need to login to MySQL command line first. Run the following command for same.
mysql -u root –p
This will prompt you for the root password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your SuiteCRM installation.
CREATE DATABASE suitecrmdata;
The above query will create a database named suitecrmdata. For the database, you can use any name you prefer in the place of suitecrmdata.
Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. Using root user is not recommended for the databases. To create a new database user, run the following query.
CREATE USER 'suitecrmuser'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username suitecrmuser. You can use any preferred username instead of suitecrmuser. Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command:;
GRANT ALL PRIVILEGES ON suitecrmdata.* TO 'suitecrmuser'@'localhost';
Now run the following command to immediately apply the changes on the database privileges.
FLUSH PRIVILEGES;
Exit MySQL prompt by executing exit command.
Once done, you can download the SuiteCRM using the following command.
cd /opt wget https://suitecrm.com/files/152/SuiteCRM%207.7/105/SuiteCRM-7.7.8.zip
At the time of writing the tutorial, the latest version of SuiteCRM is 7.7.8. You can always check for the latest version on SuiteCRM download page.
Extract the files using the following command.
unzip SuiteCRM-7.7.8.zip
If you do not have unzip installed, you can run yum -y install unzip.
The above command will extract the files in SuiteCRM-7.7.8 directory. Move all the files to the web root directory of Apache web server using the following command.
mv SuiteCRM-7.7.8/* /var/www/html cd /var/www/html
Provide the ownership of the files to the Apache web server user by running the following command.
chown -R apache:apache /var/www/html
Adjust SELinux permissions using the following commands.
chcon -R -t httpd_sys_content_rw_t /var/www/html setsebool httpd_can_network_connect_db=on setsebool httpd_can_network_connect=on setsebool httpd_can_sendmail=on setsebool httpd_unified=on
Now you can go to your favorite browser and browse the following link.
http://serverIPaddress Or http://yourdomain.comYou will see following interface.
Accept the license agreement and Choose a language for installation. Click Next to go further. Installer will now check for the system requirements. If you have followed this tutorial, you should see that all the requirements are met.
Click Next to proceed further. In next interface, you will be required to provide the database credentials and Admin user credentials.
Provide the database name which we have created earlier, provide the hostname
localhost and the username and password of the database user.
In administration user, provide the admin username password. Choose a URL for your SuiteCRM instance and your email address.
In More Options, you can choose to import the demo data provided by the installer. It can help you evaluate the product. For a production installation, you may not want to import anything. Choose accordingly.
In Scenario Selection, you can choose that which modules should be activated in the application. You can also modify this setting in administration settings once it's installed.
In SMTP Server Specification, you can specify the SMTP server by which SuiteCRM will send emails. You can use the settings for email providers like Gmail, Yahoo Mail or you can also choose to provide SMTP server for other application as well. Provide the hostname for your SMTP server and choose a port on which SMTP is running on the mail server. Select SMTP authentication checkbox and provide your email address and password for your mail account. Select if you want to use SMTP over SSL or TLS. Select Allow users to use this account for outgoing email: if you want your users to use the email to send the emails from their account.
In Branding option you can provide the name of your organization and its logo. Name of your organization will appear on the title bar and the logo will appear in the place of SuiteCRM logo.
In System Locale settings you can choose the data and time format for your application. Choose a time zone for your application and also provide which currency you wish to use with your CRM application. These settings will be considered as the default settings, but users can modify this according to their need.
In Site Security option you can specify a custom directory for your Sessions and Logs. Click Next to proceed further. It will now generate the configuration file and will place it on the system. It will also write the data on the database.
Once the installation finishes, you will be automatically taken to the login screen.
Log in using the administrator credentials provided during installation and you will see SuiteCRM dashboard as shown below.
SuiteCRM installation is now finished.
To automatically run SuiteCRM scheduler, you will need to add a cron job in your system. Run the following command to open your crontab file.
crontab –e
Add the following line at in the file.
    *    *    *    *    *     cd /var/www/html; php -f cron.php > /dev/null 2>&1
Save and exit from editor.
Conclusion
In this tutorial, we have learned to install SuiteCRM application on CentOS 7 server. You can now deploy the application to increase the productivity of your organization.


Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Powerade Coupons