Debian Apache

Installing Faveo Helpdesk Freelancer, paid and Enterprise on Debian

debian

Faveo can run on Debian 10 (Buster).

Prerequisites

  • Apache (with mod_rewrite enabled)
  • PHP 7.3+ with the following extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
  • MySQL 5.7+ or MariaDB 10.3+

a. LAMP Installation

Follow the instructions here If you follow this step, no need to install Apache, PHP, MySQL separetely as listed below

An editor like vim or nano should be useful too. Run the following commands as sudoers or Login as root user by typing the command below

sudo su

b. Update the packages

apt update

e. PHP 7.3+

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

apt install -y php7.3 libapache2-mod-php7.3 php7.3-mysql \
    php7.3-cli php7.3-common php7.3-fpm php7.3-soap php7.3-gd \
    php7.3-json php7.3-opcache  php7.3-mbstring php7.3-zip \
    php7.3-bcmath php7.3-intl php7.3-xml php7.3-curl  \
    php7.3-imap php7.3-ldap php7.3-gmp 

Now enable apache2 to start upon reboot.

systemctl enable apache2

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

nano /etc/php/7.3/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

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 in the last step

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

d. MariaDB:

The official Faveo installation uses Mysql 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.

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

apt install -y mariadb-server

Installation steps

Once the softwares above are installed:

1. Upload Faveo

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

/var/www/faveo

2. 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

3. Configure Apache webserver

1. 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 {} \;

2. Enable the rewrite module of the Apache webserver:

a2enmod rewrite

3. 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. 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 php7.3-fpm

4. Install Faveo

Now you can install Faveo via GUI Wizard or CLI

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.

Create a new /etc/cron.d/faveo file with:

echo "* * * * * www-data /usr/bin/php /var/www/faveo/artisan schedule:run 2>&1" | sudo tee /etc/cron.d/faveo

6. Redis Installation

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

This is an optional step and 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.

This is an optional step and will improve system security and is highly recommended.

Let’s Encrypt SSL installation documentation

6. Final step

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

Updated: