Skip to content

Faveo Helpdesk Installation on CentOS 7 with Nginx on PHP 7.1

Vijaya Kumar edited this page May 15, 2019 · 19 revisions

Introduction

This document will list on how to install Faveo Helpdesk on a new CentOS server.

We will install following dependencies in order to make Faveo Help-Desk work

  • NGINX
  • PHP 7.1
  • PHP Extensions: listed in server requirement
  • MySQL/MariaDB
  • Composer
  • Cron Job

Read the detailed list of server requirement

We are using vi editor throughout to open and edit file, you can use nano editor also

Configure IP Tables

Please note that you have to make changes in the iptables configurations. This allows to open ports that are necessary in Faveo installation.

This is an optional step, If you are able to access your server remotely on Public IP. This step will not be required. Mainly on local network server this step is required. If you are purchasing/renting server in a data centre this step might not be required.

iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT

PS:

  • You have to reset the firewall and iptables to your specifications
  • This step might vary for different data centres or cloud service providers, Please check with your hosting company on opening port number and correct settings

Create a user for faveo and update all the repos.

useradd -r www-data

usermod -G www-data www-data

mkdir -p /home/www-data

Download EPEL keys

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Update Yum

yum update -y

In this step we install following

  • PHP and Extensions
  • MariaDB
  • Git
  • Curl
  • Openssl

Start Installation

yum install -y nginx git curl openssl php71w-cli.x86_64 php71w-common.x86_64 php71w-fpm.x86_64 php71w-gd.x86_64 php71w-mbstring.x86_64 php71w-mcrypt.x86_64 php71w-mysql.x86_64 php71w-odbc.x86_64 php71w-pdo.x86_64 php71w-xml.x86_64 mod_php71w php71w-opcache php71w-imap.x86_64 php71w-bcmath.x86_64                                                                            

systemctl stop nginx && systemctl stop php-fpm

Install,Start Mysql and Create Database for faveo

yum install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation
mysql -u root -p
CREATE DATABASE faveo;
GRANT ALL PRIVILEGES ON faveo.* TO 'faveouser'@'localhost' IDENTIFIED BY 'faveouserpass';
FLUSH PRIVILEGES;
quit

Install ionCube Loader

ionCube is not required for Community edition

cd /home
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xfz ioncube_loaders_lin_x86-64.tar.gz
ls ioncube
php -i | grep extension_dir
Copy the Path for PHP modules according to your php v
cp ioncube/ioncube_loader_lin_7.1.so /usr/lib64/php/modules
where /usr/lib64/php/modules/ will be the php module path directory
vi /etc/php.ini

Add the below line to php.ini file

zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.1.so
systemctl restart nginx.service php-fpm.service

By checking php version we can verify the loader installed version

php -v

If ioncube loader is not working

Add the below line to php-fpm ini file


"zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.1.so"

Copy Faveo Help Desk from Github

Faveo files can be manually uploaded to server or copied from Github, if you have access to Github account then use this step, else follow the next step

Create a folder for Faveo and upload Faveo Help-Desk Community

mkdir -p /opt/faveo/faveo-helpdesk
git clone https://github.com/ladybirdweb/faveo-helpdesk.git /opt/faveo/faveo-helpdesk

OR Copy Faveo Help Desk via SSH

Incase you want to upload the Faveo files from your local system to your server and not use Github, then follow this step Download the Faveo zip file from our billing site https://www.faveohelpdesk.com Use a File transferring client like Filezilla,WinSCP to upload the files to our server directory. Open Filezilla and enter the root Credentials of the server and login.

Create a folder for faveo inside that in the path /opt/faveo/faveo-helpdesk

Make sure that you have extracted all the files under that folder /opt/faveo/faveo-helpdesk/

Now continue the process by logging in back to ssh terminal

To upload files via SSH

Login to the File directory

scp faveo.zip username@destination:/opt/faveo

Once the transfer is completed unzip the faveo.zip file and rename it to faveo-helpdesk.

For unzip tool installation and unzipping you can use the below command

yum install -y unzip
then
unzip faveo.zip

Give correct file permission to Faveo files

chown -R www-data:www-data /opt/faveo
 
chmod -R 755 /opt/faveo

chmod -R 755 /opt/faveo/faveo-helpdesk

chmod -R 755 /opt/faveo/faveo-helpdesk/storage

chmod -R 755 /opt/faveo/faveo-helpdesk/bootstrap

Configure Nginx

Create copy of Nginx default config file

mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.back
wget -O /etc/nginx/nginx.conf https://www.faveohelpdesk.com/user-manual/code/centos7/nginx-conf.txt

Edit domain & create Nginx conf using vim editor

vi /etc/nginx/conf.d/faveo-helpdesk.conf

Paste the below code in your configuration.

upstream faveo_php {
    server unix://opt/faveo/faveo-helpdesk/faveo_php.socket;
}
 server {
    listen 80;
    listen 127.0.0.1:80;
        # Edit the following line with the correct information.
    server_name %(SERVERNAME)s;
    error_log /var/log/nginx/faveo_error_log;
    access_log /var/log/nginx/faveo_access_log;
    root /opt/faveo/faveo-helpdesk/public;
    index index.php index.html index.htm;
    error_page 403 404 405 500 501 502 503 504 @error;
  try_files $uri $uri/ /index.php?$args;
    location @error {
        rewrite ^/(.*)$ /index.php?$1;
}
 
    location ~ /\. {
        deny all;
    }
     location ~ /(artisan|composer.json|composer.lock|gulpfile.js|LICENSE|package.json|phpspec.yml|phpunit.xml|README.md|readme.txt|release-notes.txt|server.php) {
        deny all;
    }
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
        	return 404;
        }
        include /etc/nginx/fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass faveo_php;
    }
}

Remove default config file

rm -rf /etc/nginx/conf.d/default.conf

Create config file for PHP FPM using vim editor

vi  /etc/php-fpm.d/faveo_php.conf

Paste the below content in the conf file.

[faveo_php]
user = www-data
group = www-data
listen = /opt/faveo/faveo-helpdesk/faveo_php.socket
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

Save and exit

Install Composer by changing the directory to faveo folder

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

Setup Cron

Path can vary according to your server. This cron is set for every 1 minute fetching.

crontab -u www-data -e
* * * * * /usr/bin/php /opt/faveo/faveo-helpdesk/artisan schedule:run >> /dev/null 2>&1

Restart services

service mariadb restart
systemctl restart nginx.service php-fpm.service

##ERROR: unable to bind listening socket for address '/opt/faveo/faveo-helpdesk/faveo_php If you get this error while run a command systemctl start php-fpm.service. Then run a commands

SELINUX=enforcing
setenforce 0

Below command is to flush iptables. Use this command only if you made changes to iptables

iptables -F

Start Installation

Now you can install Faveo via GUI Wizard or CLI.

You can access Faveo url in the browser

PS:

  • You have to reset the firewall and iptables to your specifications
  • You need to follow steps yourself to harden the security of your server, server security is not covered in this article
  • Redis is recommended for messaging que and improving system performance
  • Always use SSL/HTTPS URL for Faveo

Installation and Upgrade Guide

Administrator's Guide

Agent's Guide

Email Integration

Release & Upgrade Notes

Known Issues

Contribute & Feedback

Knowledge Base

Third Party Integration

Plugins

API

Clone this wiki locally