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 https://s3.amazonaws.com/clientexec/clientexec_5_4_5_ioncube.zip
unzip clientexec_5_4_5_ioncube.zip -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 https://www.softwarecollections.org/en/scls/remi/php56more/epel-7-x86_64/download/remi-php56more-epel-7-x86_64.noarch.rpm

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://127.0.0.1:9000″’ >>  /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 http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar vxf ioncube_loaders_lin_x86-64.tar.gz ioncube/ioncube_loader_lin_5.6.so
mv ioncube/ioncube_loader_lin_5.6.so /opt/rh/rh-php56/root/usr/lib64/php/modules/

echo “zend_extension = /opt/rh/rh-php56/root/usr/lib64/php/modules/ioncube_loader_lin_5.6.so” >> /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!)

mysql
CREATE DATABASE clientexec;
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/