Installing Faveo Helpdesk on Debian With Apache Webserver

debian

Faveo can run on Debian 11 (Bullseye), Debian 12 (Bookworm).

This document is meant for Faveo Freelancer, Paid and Enterprise Versions.

Installation steps :

  • Apache (with mod_rewrite enabled)
  • PHP 8.2+ with the following extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
  • MySQL 8.0+ or MariaDB 10.6+
  • SSL ,Trusted CA Signed or Self-Signed SSL

1. Update the packages

Run the following commands as sudoers or Login as root user by typing the command below

sudo su
apt update

1.a. Install some Utility packages

apt install -y git wget curl unzip nano zip

1.b. Apache should come pre-installed with your server. If it’s not, install it with:

apt install -y apache2
systemctl start apache2
systemctl enable apache2

1.c. PHP 8.2+

Note: In Debian upon installing PHP packages apache2 will be automatically installed and started.

Before we install PHP 8.2, it’s important to make sure your system is up to date by running the following apt commands.

sudo apt update
sudo apt install apt-transport-https lsb-release ca-certificates

Add the Ondřej Surý PHP repository.

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

Now Install PHP 8.2 and extensions.

sudo apt update
apt install -y php8.2 libapache2-mod-php8.2 php8.2-mysql \
    php8.2-cli php8.2-common php8.2-fpm php8.2-soap php8.2-gd \
    php8.2-opcache  php8.2-mbstring php8.2-zip \
    php8.2-bcmath php8.2-intl php8.2-xml php8.2-curl  \
    php8.2-imap php8.2-ldap php8.2-gmp php8.2-redis php8.2-memcached

After installing PHP 8.2, run the commands below to open PHP default config file.

nano /etc/php/8.2/fpm/php.ini

Then make the changes on the following lines below in the file and save. The value below are great settings to apply in your environments.

file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
cgi.fix_pathinfo = 0
upload_max_filesize = 100M
max_execution_time = 360

1.d. Setting Up ionCube

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz 
tar xvfz ioncube_loaders_lin_x86-64.tar.gz 

Make the note of path and directory from the above command.

Copy ioncube loader to Directory. Replace your yourpath below with actual path that was shown with the first command below.

php -i | grep extension_dir
cp ioncube/ioncube_loader_lin_8.2.so /usr/lib/php/'replaceyourpath'
sed -i '2 a zend_extension = "/usr/lib/php/'replaceyourpath'/ioncube_loader_lin_8.2.so"' /etc/php/8.2/apache2/php.ini
sed -i '2 a zend_extension = "/usr/lib/php/'replaceyourpath'/ioncube_loader_lin_8.2.so"' /etc/php/8.2/cli/php.ini
sed -i '2 a zend_extension = "/usr/lib/php/'replaceyourpath'/ioncube_loader_lin_8.2.so"' /etc/php/8.2/fpm/php.ini
systemctl restart apache2 

1.e. Install MySQL/MariaDB

The official Faveo installation uses Mysql/MariaDB as the database system and this is the only official system we support. While Laravel technically supports PostgreSQL and SQLite, we can’t guarantee that it will work fine with Faveo as we’ve never tested it. Feel free to read Laravel’s documentation on that topic if you feel adventurous.

You can install either MySQL or MariaDB. We have given options for both MySQL and MariaDB below.

1.e.1. MySQL

Install Mysql 8.0. Note that this only installs the package, but does not setup Mysql. This is done later in the instructions:

For Debian 11, 12

sudo apt update
wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
sudo dpkg -i mysql-apt-config*

A pop-up window displays after you run the above command. Select MySQL Server & Cluster with the Arrow key and hit Enter.

In this instance, MySQL-8.0 is the version of the server that was available. Select MySQL-8.0 and click Enter.

Now, click OK on your screen to finish the configuration.

sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql
sudo systemctl enable mysql

Secure your MySql installation by executing the below command. Set Password for mysql root user by providing a strong password combination of Uppercase, Lowercase, alphanumeric and special symbols, remove anonymous users, disallow remote root login, remove the test databases and finally reload the privilege tables.

sudo mysql_secure_installation 

1.e.2. MariaDB 10.6

Install MariaDB 10.6. Note that this only installs the package, but does not setup Mysql. This is done later in the instructions:

NOTE : Debian 12 does not currently support MariaDB version 10.6.

For Debian 11

sudo apt update
sudo apt-get install curl software-properties-common dirmngr
curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo bash mariadb_repo_setup --mariadb-server-version=10.6
sudo apt-get update
sudo apt-get install mariadb-server mariadb-client
sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure your MySql installation by executing the below command. Set Password for mysql root user by providing a strong password combination of Uppercase, Lowercase, alphanumeric and special symbols, remove anonymous users, disallow remote root login, remove the test databases and finally reload the privilege tables.

sudo mysql_secure_installation 

1.f. Install wkhtmltopdf

Wkhtmltopdf is an open source simple and much effective command-line shell utility that enables user to convert any given HTML (Web Page) to PDF document or an image (jpg, png, etc).

It uses WebKit rendering layout engine to convert HTML pages to PDF document without losing the quality of the pages. Its is really very useful and trustworthy solution for creating and storing snapshots of web pages in real-time.

For Debian 11

apt-get -y install wkhtmltopdf

For Debian 12

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
sudo apt install ./wkhtmltox*bookworm_amd64.deb

1.g. Install Meilisearch

MeiliSearch is an open-source search engine developed in Rust that delivers flexible search and indexing capabilities. It adeptly handles typos, supports full-text search, synonyms, and comes packed with various features, making it an ideal choice for elevating search functionalities in Faveo.

Meilisearch installation documentation

2. Upload Faveo

Please download Faveo Helpdesk from https://billing.faveohelpdesk.com and upload it to below directory

mkdir -p /var/www/faveo/
cd /var/www/faveo/

Extracting the Faveo-Codebase zip file

unzip "Filename.zip" -d /var/www/faveo

3. Setup the database

First make the database a bit more secure.

mysql_secure_installation

Next log in with the root account to configure the database.

mysql -u root -p

Create a database called ‘faveo’.

CREATE DATABASE faveo;

Create a user called ‘faveo’ and its password ‘strongpassword’.

CREATE USER 'faveo'@'localhost' IDENTIFIED BY 'strongpassword';

We have to authorize the new user on the faveo db so that he is allowed to change the database.

GRANT ALL ON faveo.* TO 'faveo'@'localhost';

And finally we apply the changes and exit the database.

FLUSH PRIVILEGES;
exit

NOTE : Please refrain from making direct MySQL/MariaDB modifications. Contact our support team for assistance.

4. Configure Apache webserver

4.a. Give proper permissions to the project directory by running:

sudo chown -R www-data:www-data /var/www/faveo
cd /var/www/faveo/
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;

4.b. Enable the rewrite module of the Apache webserver:

a2enmod rewrite

4.c. Configure a new Faveo site in apache by doing:

Pick a editor of your choice copy the following and replace ‘–DOMAINNAME–’ with the Domainname mapped to your Server’s IP or you can just comment the ‘ServerName’ directive if Faveo is the only website served by your server.

nano /etc/apache2/sites-available/faveo.conf
<VirtualHost *:80>
    ServerName --DOMAINNAME--

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/faveo/public

    <Directory /var/www/faveo/public>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

4.d. Apply the new .conf file and restart Apache and PHP-FPM. You can do that by running:

a2dissite 000-default.conf
a2ensite faveo.conf
systemctl restart apache2
systemctl restart php8.2-fpm

5. Configure cron job

Faveo requires some background processes to continuously run. Basically those crons are needed to receive emails To do this, setup a cron that runs every minute that triggers the following command php artisan schedule:run.

(sudo -u www-data crontab -l 2>/dev/null; echo "* * * * * /usr/bin/php /var/www/faveo/artisan schedule:run 2>&1") | sudo -u www-data crontab -

6. Redis Installation

Redis is an open-source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.

This will improve system performance and is highly recommended.

Redis installation documentation

7. SSL Installation

Secure Sockets Layer (SSL) is a standard security technology for establishing an encrypted link between a server and a client. Let’s Encrypt is a free, automated, and open certificate authority.

Faveo Requires HTTPS so the SSL is a must to work with the latest versions of faveo, so for the internal network and if there is no domain for free you can use the Self-Signed-SSL.

Let’s Encrypt SSL installation documentation

Paid SSL certificate Documentation

Self Signed SSL certificate Documentation

8. Install Faveo

At this point if the domainname is propagated properly with your server’s IP you can open Faveo in browser just by entering your domainname. You can also check the Propagation update by Visiting this site www.whatsmydns.net.

Now you can install Faveo via GUI Wizard or CLI

9. Faveo Backup

At this stage, Faveo has been installed, it is time to setup the backup for Faveo File System and Database. Follow this article to setup Faveo backup.

10. Final step

The final step is to have fun with your newly created instance, which should be up and running to http://localhost or the domain you have configured Faveo with.

Updated: