How to install ClientExec on CentOS 7

In this article, we will show you how to install ClientExec on a CentOS server.

  1. Login to your server via SSH or KVM, via root.
  2. Disable selinux;

setenforce 0
sed -i ‘s/enforcing/disabled/g’ /etc/selinux/config

3. Run the following command to install all the required packages for your Apache & MySQL stack, and other prerequisites, which will host ClientExec;

yum install unzip httpd mariadb-server mod_ssl -y

4. Run the following command to download the ClientExec package, and put it in place, this is the latest package, at the time of writing;

curl -O
unzip -d /var/www/html/

5. We now need to install a version of PHP above 5.6 to be compatible with ClientExec.

yum install centos-release-scl epel-release

yum-config-manager –enable rhel-server-rhscl-7-rpms

rpm -Uvh

yum install rh-php56 rh-php56-php-gd rh-php56-php-mysqlnd rh-php56-php-pdo rh-php56-php-json rh-php56-php-curl rh-php56-php-fpm rh-php56-php-mbstring rh-php56-php-soap more-php56-php-mcrypt more-php56-php-imap

scl enable rh-php56 bash

6. Add the following config to the file /etc/httpd/conf.d/php.conf, this allows for Apache to pass the requests to PHP-FPM;

echo ‘<IfModule !mod_php5.c>’ >> /etc/httpd/conf.d/php.conf
echo ‘<FilesMatch \.php$>’ >>  /etc/httpd/conf.d/php.conf
echo ‘SetHandler “proxy:fcgi://″’ >>  /etc/httpd/conf.d/php.conf
echo ‘</FilesMatch>’ >> /etc/httpd/conf.d/php.conf
echo ‘</IfModule>’  >> /etc/httpd/conf.d/php.conf

7. Update the Apache config to allow for htaccess and PHP to be used, and update the timezone configuration in PHP (drupal will need this later);

sed -i ‘s/AllowOverride [Nn]one/AllowOverride all/g’ /etc/httpd/conf/httpd.conf
sed -i ‘s/DirectoryIndex index.html/DirectoryIndex index.php index.html/g’ /etc/httpd/conf/httpd.conf
sed -i ‘s/;date.timezone =/date.timezone = “America\/New_York”/g’ /etc/opt/rh/rh-php56/php.ini

8. We also need to enable ioncube for ClientExec to work, downloading the latest copy of ioncube_loaders from the website;

curl -O
tar vxf ioncube_loaders_lin_x86-64.tar.gz ioncube/
mv ioncube/ /opt/rh/rh-php56/root/usr/lib64/php/modules/

echo “zend_extension = /opt/rh/rh-php56/root/usr/lib64/php/modules/” >> /etc/opt/rh/rh-php56/php.ini

9. Update the permissions so Apache can access clientexec;

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

10. Start Apache & MySQL on the server;

systemctl start httpd && systemctl start rh-php56-php-fpm && systemctl start mariadb

11. You should now be able to confirm that you can access the ClientExec installer by going to your http://SERVER-DOMAIN-IP/clientexec/

12. Create the MySQL user and database for ClientExec, enter the mysql command to get to a prompt (choose a different password to the below one, just make sure it is secure!)

GRANT ALL PRIVILEGES ON clientexec.* TO ‘clientexec’@’localhost’ IDENTIFIED BY ‘Eh4wph8WItSO’;

13. Continue through the installer and you will then be able to login to your site at http://IP-ADDRESS/clientexec/