How to install SuiteCRM 7.8.3 on Fedora 25 Minimal


  • Service Provider

    The official SuiteCRM instructions are absolutely atrocious.

    This guide assumes that you are starting from Fedora 25 Minimal similar to where these instructions leave you.

    This guide also assumes that you are installing SuiteCRM 7.8.3. The instructions for other versions may or may not differ.

    Install useful packages

    dnf install -y wget nano rsync sysstat htop glances
    

    Install required packages

    dnf install -y unzip httpd mariadb mariadb-server php php-mysqli php-gd php-xml php-mbstring php-pecl-zip php-imap php-pear-Net-Curl ImageMagick policycoreutils-python-utils
    

    Download SuiteCRM from here: https://suitecrm.com/download
    You will have to register to get the download file.
    Copy the downloaded ZIP file to your server with SCP/FTP/whatever
    For example: scp SuiteCRM-7.8.3.zip [email protected]:/root/SuiteCRM-7.8.3.zip

    Assuming you copied it to /root, extract the zip

    unzip SuiteCRM-7.8.3.zip -d /var/www/html
    

    Rename the extracted folder

    mv /var/www/html/SuiteCRM-7.8.3 /var/www/html/suitecrm
    

    Set ownership

    chown -R apache:apache /var/www/html/suitecrm/
    

    Set read/write permissions

    chmod -R 755 /var/www/html/suitecrm/
    chmod -R 775 /var/www/html/suitecrm/cache
    chmod -R 775 /var/www/html/suitecrm/custom
    chmod -R 775 /var/www/html/suitecrm/modules
    chmod -R 775 /var/www/html/suitecrm/themes
    chmod -R 775 /var/www/html/suitecrm/data
    chmod -R 775 /var/www/html/suitecrm/upload
    chmod 775 /var/www/html/suitecrm/config_override.php
    

    Open the firewall for http

    firewall-cmd --zone=public --add-port=http/tcp --permanent
    firewall-cmd --reload
    

    Start the mariadb and set to start on boot

    systemctl start mariadb
    systemctl enable mariadb
    

    Create a database for SuiteCRM and a user to access it.

    mysql -e "CREATE DATABASE suitecrm;"
    mysql -e "CREATE USER 'scrmuser'@'localhost' IDENTIFIED BY 'scrmuserpassword';"
    mysql -e "GRANT ALL ON suitecrm.* TO 'scrmuser'@'localhost';"
    mysql -e "FLUSH PRIVILEGES;"
    

    Secure mariadb. These commands do what mysql_secure_installation does interactively

    mysql -e "UPDATE mysql.user SET Password=PASSWORD('somesecurepassword') WHERE User='root';"
    mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
    mysql -e "DELETE FROM mysql.user WHERE User='';"
    mysql -e "DROP DATABASE test;"
    mysql -e "FLUSH PRIVILEGES;"
    

    Tell SELinux to let it send mail and talk on the network

    setsebool -P httpd_can_sendmail 1
    setsebool -P httpd_can_network_connect 1
    

    Tell SELinux that these directories need to write

    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/cache(/.*)?"
    restorecon -R /var/www/html/suitecrm/cache
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/custom(/.*)?"
    restorecon -R /var/www/html/suitecrm/custom
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/modules(/.*)?"
    restorecon -R /var/www/html/suitecrm/modules
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/themes(/.*)?"
    restorecon -R /var/www/html/suitecrm/themes
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/data(/.*)?"
    restorecon -R /var/www/html/suitecrm/data
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/upload(/.*)?"
    restorecon -R /var/www/html/suitecrm/upload
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm/config_override.php"
    restorecon -R /var/www/html/suitecrm/config_override.php
    

    Edit /etc/php.ini to have the following settings found in the upgrade section of the official guide

    sed -i -e 's/post_max_size = 8M/post_max_size = 60M/' /etc/php.ini
    sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 60M/' /etc/php.ini
    sed -i -e 's/max_input_time = 60/max_input_time = 300/' /etc/php.ini
    sed -i -e 's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini
    

    Create an Apache virtual host file

    cat > /etc/httpd/conf.d/suitecrm.conf << EOF
    LoadModule rewrite_module modules/mod_rewrite.so
    
    <VirtualHost *:80>
    ServerAdmin [email protected]
        <Directory /var/www/html/suitecrm>
            Allow From All
            AllowOverride All
            Options +Indexes
       </Directory>
        DocumentRoot /var/www/html/suitecrm
        ServerName crm.domain.com
            ErrorLog /var/log/httpd/suitecrm.error.log
            CustomLog /var/log/access.log combined
    </VirtualHost>
    EOF
    

    Restart Apache and enable for reboot.

    systemctl restart httpd
    systemctl enable httpd
    

    Disbale SELinux temporarily.

    setenforce 0 
    

    Make sure your DNS name is setup wherever your DNS is controlled.

    Go to install page
    http://crm.domain.com/install.php

    Accept the agreement and click next.
    0_1494800221031_upload-0e60c078-da5a-4ff9-9b12-4d0101438984

    Verify everything shows ok and click next.
    0_1494799006990_upload-a73aa9f4-c089-4787-907e-b17d92b39dc5

    Change the SuiteCRM Database user to Provide Existing User.
    0_1494799192729_upload-535b01aa-b3e2-4b3d-a7e4-b92053b3bcd7

    Populate the database appropriately.
    Change the server to localhost and fill in with the database user and password previously setup.
    0_1494800339213_upload-8f3ca7f7-2bfa-42ed-a5d2-16574f0cf48a

    Populate the initial admin account info
    0_1494800490101_upload-660c903f-0c7c-41cc-8f33-77b4c1a1602f

    Expand each of these options and set them up appropriately.
    I leave everything default, except for populating the email settings.
    0_1494800578478_upload-1dd6f461-649c-48aa-bc22-b7b1e36de46a

    Click next, and you will see a progress bar while it sets everything up and then get redirected to the login page.
    0_1494801193955_upload-c602cb28-03ac-4d20-8d40-98b7d424706e

    Go turn SELinux back to enforcing.

    setenforce 1
    

  • Service Provider

    Reserved to enable SSL

    To enable SSL you sinply need to install mod_ssl to get a self signed certificate, but nobody wants that.

    So, assuming that you have no proxy in front of this system, we will use certbot to get a certificate.

    Install the required packages

    dnf install -y mod_ssl certbot python-certbot-apache
    

    Allow SSL through the firewall

    firewall-cmd --zone=public --add-port=https/tcp --permanent
    firewall-cmd --reload
    

    Restart Apache

    systemctl restart httpd
    

    Run certbot

    certbot --apache -n --agree-tos --email [email protected] -d crm.domain.com
    

    You should now have a new vhost configuration file named /etc/httpd/conf.d/suitecrm-le-ssl.conf

    Restart Apache

    systemctl restart httpd
    

    Navigate to your site.
    https://crm.domain.com

    I just did this on a new Vultr instance and actually setup the SSL prior to running the install wizard.
    0_1494867791311_upload-ec17e64d-d106-495e-bd45-510b323beddd

    If you wish to disable non SSL, traffic, run this

    #remove the allow for http
    firewall-cmd --zone=public --remove-port=80/tcp --permanent
    #reload the firewall
    firewall-cmd --reload
    

  • Service Provider

    Please let me know if anyone runs into a problem. I had a couple oddities both times I installed this. But each time the oddity was different.


  • Service Provider

    The installer in the GUI needs to have SELinux disbaled because it creates files that simply do not exist prior to the the execution of the wizard.

    It is more than 1 file and I did not feel like taking to time to figure all of them out.

    The most critical were the config.php and.htaccess` files. If SELinux is enabled, it cannot create them.



  • Nice write up.

    About SELinux, any issue with just doing this?

    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm(/.*)?"
    restorecon -R /var/www/html/suitecrm

    Would help with any future changes or additions in the suitecrm directories.


  • Service Provider

    @black3dynamite said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    Nice write up.

    About SELinux, any issue with just doing this?

    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/suitecrm(/.*)?"
    restorecon -R /var/www/html/suitecrm

    Would help with any future changes or additions in the suitecrm directories.

    It is more permissions than minimum, so I would really not do it. It will work though.



  • @JaredBusch said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    chmod -R 755 /var/www/html/suitecrm/
    chmod -R 775 /var/www/html/suitecrm/cache
    chmod -R 775 /var/www/html/suitecrm/custom
    chmod -R 775 /var/www/html/suitecrm/modules
    chmod -R 775 /var/www/html/suitecrm/themes
    chmod -R 775 /var/www/html/suitecrm/data
    chmod -R 775 /var/www/html/suitecrm/modules
    chmod 775 /var/www/html/suitecrm/config_override.php

    You have modules listed twice


  • Service Provider

    @FATeknollogee he wants to be very sure.


  • Service Provider

    @FATeknollogee said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    @JaredBusch said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    chmod -R 755 /var/www/html/suitecrm/
    chmod -R 775 /var/www/html/suitecrm/cache
    chmod -R 775 /var/www/html/suitecrm/custom
    chmod -R 775 /var/www/html/suitecrm/modules
    chmod -R 775 /var/www/html/suitecrm/themes
    chmod -R 775 /var/www/html/suitecrm/data
    chmod -R 775 /var/www/html/suitecrm/modules
    chmod 775 /var/www/html/suitecrm/config_override.php

    You have modules listed twice

    That last one should have been upload.. Instructions fixed.



  • Also, remember to use your own server name:

    0_1494856648268_suite.PNG


  • Service Provider

    @FATeknollogee said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    Also, remember to use your own server name:

    0_1494856648268_suite.PNG

    I did skip the big bold text to find/replace things with your own info...

    I guess I should go back and add that.



  • @JaredBusch I think for now it's ok..
    I spun up a new Fed 25 vm & I'm using your instruction set.
    So far it's all good.



  • Was this "Admin" user setup in a previous step, I don't seem to remember setting this up?

    0_1494859099333_suite.PNG


  • Service Provider

    @FATeknollogee said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    Was this "Admin" user setup in a previous step, I don't seem to remember setting this up?

    0_1494859099333_suite.PNG

    No, this is new creation for the account you will log into the Web GUI with.



  • @JaredBusch said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    dnf install -y mod_ssl cerbot

    typo, you forgot the "t" in certbot


  • Service Provider

    @FATeknollogee said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    @JaredBusch said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    dnf install -y mod_ssl cerbot

    typo, you forgot the "t" in certbot

    Just start to document that process and I was interupted by a client call.



  • @JaredBusch Ha, I hear ya!


  • Service Provider

    @FATeknollogee said in How to install SuiteCRM 7.8.3 on Fedora 25 Minimal:

    @JaredBusch Ha, I hear ya!

    SSL instructions updated.



Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.