How to install SuiteCRM on Rocky Linux 9

How to install SuiteCRM on CentOS/Rocky Linux 9

In this Linux tutorial, you will learn how to install SuiteCRM on Rocky Linux 9 or other Red Hat based Linux distributions.

 

Table of Contents:

     

    What is SuiteCRM?:

    SuiteCRM is a software fork of the popular customer relationship management (CRM) system from SugarCRM and its base is built on the last open-source SugarCRM release. The SuiteCRM project began when SugarCRM decided to stop the development of its open-source version. (Open-source CRM is often used as an alternative to proprietary CRM software from major corporations such as HubSpot, Salesforce, and Microsoft Dynamics CRM applications.)

    It was originally released on October 21, 2013, as version 7.0 and provides upgrade paths for existing SugarCRM users. It is an extended version of SugarCRM which contains additional security fixes not available in SugarCRM.

    SuiteCRM comprises the last release of the SugarCRM Community Edition plus the following additional modules:

    • Products
    • Quotes
    • Contracts
    • Invoices
    • PDF Templates
    • Workflow
    • Reporting
    • Search
    • Events
    • Google Maps
    • Teams Security
    • Portal
    • Responsive Theme
    • Outlook plugin
    • Surveys

    A six-month release cycle is maintained with bug fix and security releases being made available between major releases. (Source: SuiteCRM Wiki)

     

    Important Links:

     

    Environment Specification:

    We are using a minimal Rocky Linux OS with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 4 GB
    • Storage - 40 GB
    • Operating System - Rocky Linux release 9.2 (Blue Onyx)
    • Hostname - suitecrm-01.centlinux.com
    • IP Address - 192.168.18.107/24

     

    Prepare your Linux Server:

    By using a ssh client, login to your Rocky Linux 9 server as root user.

    Set a Fully Qualified Domain Name (FQDN) for your Linux machine and set Local DNS resolution for it.

    # hostnamectl set-hostname suitecrm-01.centlinux.com
    # echo "192.168.18.107 suitecrm-01 suitecrm-01.centlinux.com" >> /etc/hosts

    Update software packages in your operating system before installing SuiteCRM sofware.

    # dnf update -y

    If the above command updates your Linux Kernel, then you should reboot before moving forward with this article.

    # reboot

    After reboot, check and note down the Linux OS and Kernel versions.

    # cat /etc/os-release
    NAME="Rocky Linux"
    VERSION="9.2 (Blue Onyx)"
    ID="rocky"
    ID_LIKE="rhel centos fedora"
    VERSION_ID="9.2"
    PLATFORM_ID="platform:el9"
    PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
    ANSI_COLOR="0;32"
    LOGO="fedora-logo-icon"
    CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
    HOME_URL="https://rockylinux.org/"
    BUG_REPORT_URL="https://bugs.rockylinux.org/"
    SUPPORT_END="2032-05-31"
    ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
    ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
    REDHAT_SUPPORT_PRODUCT="Rocky Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
    
    # uname -r
    5.14.0-284.30.1.el9_2.x86_64

     

    Installing SuiteCRM Prerequisites:

    The Open Source CRM Software requires some packages, therefore, install them now with the help of dnf command.

    # dnf install -y wget unzip zlib-devel

     

    Installing MariaDB Server:

    SuiteCRM needs a MySQL database for it's backend data store. Therefore, we are installing MariaDB Server on the same Linux machine.

    # dnf install -y mariadb-server

    Enable and start MariaDB database service.

    # systemctl enable --now mariadb.service
    Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

    Perform initial configurations of the most popular Open Source database server.

    # mariadb-secure-installation
    
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    In order to log into MariaDB to secure it, we'll need the current
    password for the root user. If you've just installed MariaDB, and
    haven't set the root password yet, you should just press enter here.
    
    Enter current password for root (enter for none):
    OK, successfully used password, moving on...
    
    Setting the root password or using the unix_socket ensures that nobody
    can log into the MariaDB root user without the proper authorisation.
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Switch to unix_socket authentication [Y/n] n
     ... skipping.
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Change the root password? [Y/n] Y
    New password:
    Re-enter new password:
    Password updated successfully!
    Reloading privilege tables..
     ... Success!
    
    
    By default, a MariaDB installation has an anonymous user, allowing anyone
    to log into MariaDB without having to have a user account created for
    them.  This is intended only for testing, and to make the installation
    go a bit smoother.  You should remove them before moving into a
    production environment.
    
    Remove anonymous users? [Y/n] Y
     ... Success!
    
    Normally, root should only be allowed to connect from 'localhost'.  This
    ensures that someone cannot guess at the root password from the network.
    
    Disallow root login remotely? [Y/n] Y
     ... Success!
    
    By default, MariaDB comes with a database named 'test' that anyone can
    access.  This is also intended only for testing, and should be removed
    before moving into a production environment.
    
    Remove test database and access to it? [Y/n] Y
     - Dropping test database...
     ... Success!
     - Removing privileges on test database...
     ... Success!
    
    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.
    
    Reload privilege tables now? [Y/n] Y
     ... Success!
    
    Cleaning up...
    
    All done!  If you've completed all of the above steps, your MariaDB
    installation should now be secure.
    
    Thanks for using MariaDB!

    Check the version of your MariaDB RDBMS.

    # mariadb --version
    mariadb  Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using EditLine wrapper

    Exceuting following set of commands at MySQL prompt to create a database and user for SuiteCRM application.

    # mysql -u root -p
    Enter password:
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 12
    Server version: 10.5.16-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> CREATE DATABASE suitedb;
    Query OK, 1 row affected (0.001 sec)
    
    MariaDB [(none)]> CREATE USER 'suiteuser'@'localhost' IDENTIFIED BY 'Ahmer@1234';
    Query OK, 0 rows affected (0.004 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON suitedb.* TO 'suiteuser'@'localhost';
    Query OK, 0 rows affected (0.004 sec)
    
    MariaDB [(none)]> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.003 sec)
    
    MariaDB [(none)]> exit;
    Bye

     

    Installing Apache HTTP Server:

    For deployment of SuiteCRM web application, you need a PHP supported web server. Therefore, we are installing Apache web server on the same Linux server.

    # dnf install -y httpd

    Enable and start Apache web service.

    # systemctl enable --now httpd.service
    Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

    Check the version of your open source web server.

    # httpd -v
    Server version: Apache/2.4.53 (Rocky Linux)
    Server built:   Apr 28 2023 00:00:00

     

    Installing PHP:

    SuiteCRM 8.4 supports PHP 7.0 or later. Fortunately, PHP 8.0 is available in standard yum repositories of Rocky Linux 9. Therefore, we are installing PHP 8.0 alongwith necessary plugins by executing following dnf command.

    # dnf install -y php-fpm php-mysqlnd php-bcmath php-xml php-zip php-curl php-mbstring php-gd php-intl php-cli php-opcache php-soap php-ldap

    Enable and start php-fpm service.

    # systemctl enable --now php-fpm
    Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.

    Check the version of PHP.

    # php --version
    PHP 8.0.27 (cli) (built: Jan  3 2023 16:17:26) ( NTS gcc x86_64 )
    Copyright (c) The PHP Group
    Zend Engine v4.0.27, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies

    Execute following set of commands to configure PHP according to SuiteCRM requirement.

    # sed -i 's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini
    # sed -i 's/max_execution_time = 30/max_execution_time = 60/' /etc/php.ini
    # sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 25M/g' /etc/php.ini
    # sed -i 's/post_max_size = 8M/post_max_size = 25M/g' /etc/php.ini

    Restart php-fpm service to apply changes.

    # systemctl restart php-fpm

     

    Configure Linux Firewall:

    To make your CRM accessible from the network, you must allow the http service in your Linux firewall.

    # firewall-cmd --permanent --add-service=http
    success
    
    # firewall-cmd --reload
    success

     

    Install SuiteCRM 8:

    Create a directory in document root of Apache web server.

    # mkdir -p /var/www/html/suitecrm
    # cd /var/www/html/suitecrm/

    Download SuiteCRM 8 with the help of wget command.

    # wget https://suitecrm.com/download/142/suite84/563421/suitecrm-8-4-1.zip
    ...
    Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 82754615 (79M) [application/octet-stream]
    Saving to: ‘/var/www/html/suitecrm/suitecrm-8-4-1.zip’
    
    suitecrm-8-4-1.zip. 100%[===================>]  78.92M  1016KB/s    in 83s
    
    2023-10-03 21:04:33 (975 KB/s) - ‘/var/www/html/suitecrm/suitecrm-8-4-1.zip’ saved [82754615/82754615]

    Unzip downloaded file of open source CRM software in current directory.

    # unzip suitecrm-8-4-1.zip

    Adjust ownership and file permissions of extracted files.

    # chown -R apache:apache .
    # chmod -R 755 .

    Create SELinux policies for SuiteCRM directories.

    # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/suitecrm/public/legacy/cache(/.*)?'
    # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/suitecrm/public/legacy/custom(/.*)?'
    # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/suitecrm/public/legacy/modules(/.*)?'
    # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/suitecrm/public/legacy/upload(/.*)?'

    Apply SELinux policies on the SuiteCRM directory.

    # restorecon -R .

    You also need to enable two SELinux booleans.

    # setsebool -P httpd_can_network_connect_db 1
    # setsebool -P httpd_can_network_connect 1

     

    Configure SuiteCRM:

    Temporary disable SELinux, so the web installer can create necessary directories during SuiteCRM installation.

    # setenforce 0

    Open URL http://suitecrm-01.centlinux.com/suitecrm/public/index.php in a web browser.

    suitecrm-configuration

    Configure SuiteCRM settings according to your requirement and click on "Proceed".

    suitecrm-system-check

    Resolve any failed system checks.

    suitecrm-login

    Login as suiteadmin user that you have created in previous configuration page.

    suitecrm-dashboard

    After successful login, you have reached at the SuiteCRM dashboard.

    Enable SELinux after completing SuiteCRM configurations.

    # setenforce 1

     

    Conclusion:

    In this Linux tutorial, you have learned how to install SuiteCRM on Rocky Linux 9 or other Red Hat based Linux distributions.

    Post a Comment

    Previous Post Next Post