FAVEO HELPDESK UBUNTU 18.04.4 INSTALLATION REQUIREMENTS

Author: Vijay Kumar 

####### Update and install nano, wget, unzip and zip #######

apt-get update -y
apt-get install nano -y
apt-get install unzip -y
apt-get install wget -y
apt-get install zip -y

####### Create firewall rules #######

FWZONE=$(firewall-cmd --get-default-zone)
firewall-cmd --zone=$FWZONE --add-service=http --permanent
firewall-cmd --zone=$FWZONE --add-service=https --permanent
firewall-cmd --reload

useradd -r www-data
usermod -G www-data www-data
mkdir -p /home/www-data

apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php

apt-get install -y curl git apache2
apt-get install -y php7.3 php7.3-mysql php7.3-curl php7.3-json php7.3-cgi php7.3-xsl
apt-get install php7.3-zip -y
apt-get install php7.3-imap -y
apt-get install php7.3-mbstring -y
apt-get install php7.3-zip -y
apt-get install php7.3-bcmath -y
apt-get install php7.3-ldap -y
apt-get install php7.3-soap -y
apt install php libapache2-mod-php7.3
apt-get install redis-server
apt-get install php7.3-redis

a2enmod php7.3
a2dismod php7.2
a2dismod php7.1
sudo update-alternatives --set php /usr/bin/php7.3

a2enmod rewrite
service apache2 restart

apt-get install -y mysql-server


###### Installing Ioncube Encoder ######

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xvfz ioncube_loaders_lin_x86-64.tar.gz
cp ioncube/ioncube_loader_lin_7.3.so /usr/lib/php/20190902
sed -i '2 a zend_extension = "/usr/lib/php/20190902/ioncube_loader_lin_7.3.so"' /etc/php/7.3/apache2/php.ini
sed -i '2 a zend_extension = "/usr/lib/php/20190902/ioncube_loader_lin_7.3.so"' /etc/php/7.3/cli/php.ini

####### Downloading Faveo from Billing #######

echo -n 'please enter your order number: '
read ordernumber

echo -n 'please enter your serial key: '
read serialkey

curl https://billing.faveohelpdesk.com/download/faveo\?order_number\=${ordernumber}\&serial_key\=${serialkey} --output faveo.zip

mkdir -p /var/www/faveo/faveo-helpdesk

cp faveo.zip /var/www/faveo/faveo-helpdesk

cd /var/www/faveo/faveo-helpdesk

unzip faveo.zip

####### Changing permissions #######

chown -R www-data:www-data /var/www/
chmod -R 755 /var/www/


cat < /etc/apache2/sites-available/faveo.conf



ServerName localhost

ServerAdmin webmaster@localhost

DocumentRoot /var/www/faveo/faveo-helpdesk/public



AllowOverride All



ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined


EOF

a2ensite faveo.conf
a2dissite 000-default.conf

####### Changing Execution Time #######

sed -i "s/max_execution_time = .*/max_execution_time = 120/" /etc/php/7.3/apache2/php.ini
sed -i "s/max_execution_time = .*/max_execution_time = 120/" /etc/php/7.3/cli/php.ini

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


####### Adding cron #######

echo "* * * * * /usr/bin/php7.3 /var/www/faveo/faveo-helpdesk/artisan schedule:run >> /dev/null 2>&1" > /var/spool/cron/www-data
chmod 700 /var/spool/cron/www-data

service mysql start
service enable mysql
mysql_secure_installation

####### Creating Database for Faveo #######

echo -n 'Please set Database Name for Faveo: '
read db_name

echo -n 'Please Database UserName for Faveo: '
read db_user

echo -n 'Please set Database User Password for Faveo: '
read db_pass


mysql -u root -p -e "CREATE DATABASE ${db_name};GRANT ALL PRIVILEGES ON ${db_name}.* TO '${db_user}'@'localhost' IDENTIFIED BY '${db_pass}';FLUSH PRIVILEGES;"


####### Enable web services #######

systemctl enable apache2
systemctl restart apache2

#Install Faveo throgh CLI
#cd /var/www/faveo/faveo-helpdesk
#php artisan install:faveo
#php artisan install:db

echo "Faveo installed successfully"
echo "You can access it on browser with your server IP/Domain"
echo "Set up database details, given at the time of installtion"

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

Automatic-installation script is available for FRESH Ubuntu 18.04.4  installs at
https://support.faveohelpdesk.com/uploads/install-scripts/helpdesk/ubuntu18/autoinstall.sh

To run, copy/paste this into the command-line
apt-get install wget -y

wget https://support.faveohelpdesk.com/uploads/install-scripts/helpdesk/ubuntu18/autoinstall.sh

Change execution permission for file.

chmod +x Faveo-ubuntu-apache.sh

Execute the script

./Faveo-ubuntu-apache.sh