1. Setup MySQL
Install the MySQL database server.
dnf install mysql-server |
Start MySQL.
systemctl start mysqld |
Create a new ICTCRM database.
CREATE DATABASE ictcrm; |
Create a database user and assign a secure password.
CREATE USER ‘suite’@’localhost’ IDENTIFIED BY ‘secure-password’; Grant the user full permissions to the ICTCRM database. GRANT ALL ON suitecrm.* TO ‘suite’@’localhost’; FLUSH PRIVILEGES; EXIT |
2. Setup PHP
Enable the PowerTools repository
dnf config-manager –set-enabled powertools |
Install the Extra Packages for Enterprise Linux (EPEL) repository.
dnf install epel-release |
Install the Remi repository.
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y |
Install PHP Version 7.4.
dnf module install php:remi-7.4 |
Install required PHP modules.
dnf install php php-fpm php-mysqlnd php-cgi php-bcmath php-json php-xml php-gettext php-common php-curl php-intl php-zip php-imap php-pear php-mbstring php-gd -y |
Edit the main PHP configuration file.
vim /etc/php.ini |
Locate the upload_max_filesize = 2M directive near line 846, and change its value to 20MB or above as required by ICTCRM.
upload_max_filesize = 20M |
Save and close the file.
Restart PHP-FPM to load changes.
systemctl restart php-fpm |
3. Setup ICTCRM
rm -rf /var/www/html/ wget https://github.com/ictinnovations/ictcrm/archive/refs/heads/ictcrm-7.13.zip |
Unzip the downloaded release file.
unzip ictcrm-7.13.zip |
Move extracted files to the ICTCRM webroot directory.
mv ictcrm-ictcrm-7.13/ /var/www/html |
Grant apache ownership permissions on the ICTCRM directory.
chown -R apache:apache /var/www/html |
Set the directory permissions mode temporarily to 777 for ICTCRM to write new files.
chmod -R 755 /var/www/html |
Restart apache.
systemctl restart httpd |
Disable firewall and SElinux
service firewalld stop setenforce 0 |
Create custom folder and config_override.php file
mkdir /var/www/html/custom touch /var/www/html/config_override.php |
Change the permissions
chmod -R 777 cache custom modules themes data upload config_override.php |
Access the ictcrm from browser via hostname / server ip and complete the installation
4. Json APIs
Before you start calling endpoints, Please ensure that you have the following:
- OpenSSL PHP Extension installed and configured
- To add the CentOS 8 EPEL repository, run the following command:
dnf install epel-release |
- Now that you have access to the repository, install all of the required packages:
dnf install certbot python3-certbot-apache mod_ssl |
- The ICTCRM instance must be configured to use HTTPS/SSL
- Add VirtualHost in httpd.conf file
vi /etc/httpd/conf/httpd.conf |
- then add following lines in httpd.conf file
<VirtualHost *:80> DocumentRoot “/usr/ictbroadcast/wwwroot” ServerName voip.baystreetcapitalventures.com </VirtualHost> |
change the document root to “/var/www/html” and set your server name
- restart Apache service
Now that Certbot is installed, you can use it to request an SSL certificate for your domain.
certbot –apache |
- Update your host & URL from “vi /var/www/html/config.php” file
Composer
Install composer package with
composer install |
Generate Private and Public.key for OAUTH2
ICTCRM Api uses OAuth2 protocol, which needs public and private keys.
First, open a terminal and go to {{ictcrm.root}}/Api/V8/OAuth2
Generate a private key:
openssl genrsa -out private.key 2048 |
then a public key:
openssl rsa -in private.key -pubout -out public.key |
The permission of the key files must be 600 or 660, so change it.
sudo chmod 600 private.key public.key |
Also, you have to be sure that the config files are owned by PHP.
sudo chown www-data:www-data p*.key |
replace the www-data:www-data with your user for example if you are using apache then replace it with apache.
OAUTH2 encryption key
OAuth2’s AuthorizationServer needs to set an encryption key for security reasons. This key has been generated during the ICTCRM installation and stored in the config.php under “oauth2_encryption_key”. If you would like to change its value you may generate a new one by running
php -r ‘echo base64_encode(random_bytes(32)), PHP_EOL; |
and then store the output in the config.php
Sample code for API Testing:
$ch = curl_init();
$header = array(
'Content-type: application/vnd.api+json',
'Accept: application/vnd.api+json',
);
$postStr = json_encode(array(
'grant_type' => 'password',
'client_id' => 'e5f33999-e1b0-2339-58af-63f5d0f697dd',
'client_secret' => 'admin',
'username' => 'admin',
'password' => 'admin',
));
$url = 'https://suit.ictcrm.com/Api/access_token';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$output = curl_exec($ch);
print_r($output);