FAVEO HELPDESK COMMUNITY UBUNTU 16.04 XENIAL LTS INSTALLATION REQUIREMENTS

Author: Mathieu Aubin 

####### MariaDB 10.1 stable repo #######

add mariadb gpg signing keys to apt, then add the repository for stable version 10.1
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.iweb.com/repo/10.1/ubuntu xenial main'

####### Nginx stable repo #######

create apt nginx repository file
sudo echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/Nginx-stable.list

add gpg key from nginx
wget -O /tmp/nginx-gpg.key http://nginx.org/keys/nginx_signing.key && sudo apt-key add /tmp/nginx-gpg.key

###### Php repository ######

add ondrej php ppa repository
sudo add-apt-repository ppa:ondrej/php

####### Mandatory webuser creation #######

create system user for our webuser and add it's group
sudo useradd www-data -r && sudo usermod -G www-data www-data

####### Mandatory directory creation #######

create directories we will use for Faveo-Helpdesk installation
sudo mkdir -p /opt/faveo/run && sudo mkdir -p /opt/faveo/log

change ownership of folders to our webuser
sudo chown www-data:www-data /opt/faveo -R

####### Mandatory package installation #######

Of course, after creating the repositories, we need to update apt's package cache...
sudo apt-get update

## PHP PACKAGES ##
sudo apt-get install php5.6-json php5.6-fpm php5.6-cli php5.6-gd php5.6-mbstring php5.6-common php5.6-mcrypt php5.6-xml php5.6-curl php5.6-imap php5.6-mysql php5.6-xmlrpc php5.6-soap

## MYSQL PACKAGE ##
sudo apt-get install mariadb-server

## NGINX PACKAGE ##
sudo apt-get install nginx

## GIT PACKAGE ##
sudo apt-get install git

NOTE- you can use this one-liner command to install all the packages...
sudo apt-get install php5.6-json php5.6-fpm php5.6-cli php5.6-gd php5.6-mbstring php5.6-common php5.6-mcrypt php5.6-xml php5.6-curl php5.6-imap php5.6-mysql php5.6-xmlrpc php5.6-soap nginx git mariadb-server

####### Faveo custom php-fpm pool definition #######

download and save our custom php-fpm pool definition
wget -O /etc/php/5.6/fpm/pool.d/faveo_php.conf http://ladybirdweb.com/support/uploads/ubuntu16.04/faveo_php-conf.txt

edit the file to enable the suggested socket
sudo nano /etc/php/5.6/fpm/pool.d/faveo_php.conf

####### Faveo Nginx basic "QuickStart" server block #######

download and save our custom very nasic quick-start nginx server block
wget -O /etc/nginx/conf.d/faveo-helpdesk.conf http://ladybirdweb.com/support/uploads/ubuntu16.04/faveo-helpdesk-conf.txt

edit the file, changing the server name to your domain name
sudo nano /etc/nginx/conf.d/faveo-helpdesk.conf

edit /etc/nginx/nginx.conf and change the user to www-data
sudo nano /etc/nginx/nginx.conf

YOU MUST remove /etc/nginx/conf.d/default.conf default server
sudo rm -rf /etc/nginx/conf.d/default.conf

####### Mandatory Faveo git repository clone #######

clone Faveo-Helpdesk's repository
sudo git clone https://github.com/ladybirdweb/faveo-helpdesk.git /opt/faveo/faveo-helpdesk

change ownership of the files/folder to our webuser
sudo chown www-data:www-data /opt/faveo/faveo-helpdesk -R

####### Mandatory Faveo MySQL blank database #######

make sure mysql service is running...
sudo service mysql start

secure mysql installation with the following command, follow prompt...
sudo mysql_secure_installation

enter mysql and create database, user and grant access to our user, reload privileges...
sudo mysql -u root -p
CREATE DATABASE faveo;
GRANT ALL PRIVILEGES ON faveo.* TO 'faveouser'@'localhost' IDENTIFIED BY 'faveouserpass';
FLUSH PRIVILEGES;
quit

####### Mandatory Faveo Cronjob #######

create Faveo-Helpdesk'S cronjob for fetching emails and notifications
sudo crontab -e

copy this into the cron file
# Read emails every 5 minutes, change to suit your needs.
*/5 * * * * /usr/bin/curl http://127.0.0.1/readmails
# Perform the notification action, once a day, at 23:55. Change if you would like another time
55 23 * * * /usr/bin/curl http://127.0.0.1/notification

############ FOR EXPERIENCED USERS ONLY ############

Automatic-installation script is available for FRESH Ubuntu 16.04 Xenial installs at
https://support.faveohelpdesk.com/uploads/install-scripts/helpdesk-community/ubuntu16/autoinstall

To run, copy/paste this into the command-line
bash <(curl -s https://support.faveohelpdesk.com/uploads/install-scripts/helpdesk-community/ubuntu16/autoinstall)