ionCube is a tool to protect PHP-based software from being viewed, modified, or run on unlicensed systems.

Some applications such as FileRun require ionCube, so let’s install it first.

sudo apt update && sudo apt upgrade -y
cd /tmp
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/local

Find the PHP configuration file (php.ini) on your system:

locate php.ini

Add this line under the [PHP] block:

[PHP]
zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so

Restart Apache and the PHP engine:

sudo systemctl restart apache2.service
sudo systemctl restart php7.0-fpm.service

Run ‘php -v‘ and confirm that ionCube is active:

PHP 7.4.8 (cli) (built: Jul 13 2020 16:46:22) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.1, Copyright (c) 2002-2020, by ionCube Ltd.
with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies

FileRun: Create an empty database, a user, and grant privileges:

mysql -u root -p

Run the following commands in the MySQL terminal:

mysql> CREATE DATABASE filerun_db;
mysql> CREATE USER 'filerun_user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL ON filerun_db.* to 'filerun_user'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;

Replace ‘filerun_db‘, ‘filerun_user‘, and ‘password‘ as needed.

Download the latest version of FileRun to your web server root:

cd /var/www/html/
sudo wget -O FileRun.zip http://www.filerun.com/download-latest
sudo unzip FileRun.zip
sudo chown -R www-data:www-data /var/www/html/

Open FileRun in your browser, for example:

http://example.com/   OR   http://127.0.0.1/

You will be asked for your database credentials:

MySQL Hostname: localhost
Database Name: filerun_db
MySQL User: filerun_user
User's Password: password

The installer will create a user called ‘superuser‘ with a randomly generated password. Copy this password to log in, then change it immediately.

To improve server security, remove certain privileges from the database user in the MySQL terminal:

REVOKE ALTER, DROP ON filerun_db.* FROM 'filerun_user'@'localhost';
FLUSH PRIVILEGES;

This should be done after installation. Before running any FileRun updates, re-apply the privileges with:

GRANT ALTER, DROP ON filerun_db.* TO 'filerun_user'@'localhost';
FLUSH PRIVILEGES;

To protect your FileRun files, change the directory ownership:

sudo chown -R root:root /var/www/html

Then allow writes only to the following directory:

sudo chown -R www-data:www-data /var/www/html/system/data

The data directory can also be moved outside the web server root:

sudo mkdir /data
sudo chown www-data:www-data /data

Then go to Settings > Admin > Users > ‘Select the User’ > Edit > Permissions > Home Folder > Path and enter: /data