Introduction Last updated: 2021-09-10

This document explains the installation of Ticketing Expert. Installation using cPanel is possible only if you have cPanel in your server. If you have a VPS or Dedicated server, then can install using terminal.

Requirements

Your PHP version should be >= 7.4 for this app to work. You must set up two cron scripts. 1) For importing emails uisng imap 2) To process Queue Jobs Details of those are given in this document.

2. Installation Using cPanel

Note: This document explains the installation of Ticketing Expert using cPanel.

Step 1: Selection of domain

First login to cPanel and you will see options as shown below.

Fig.2.1 Domain Setup - Step-1

You can install this app using any domain or subdomain.
You just have to select the domain if it’s already there or create a subdomain. In both cases the document root should be like
<somepath>/public
In our example installation domain is http://statuskart.com
and document root is /home/kycdyuvx/statuskart.com/public
Note that the public should be at the end of the document root /home/kycdyuvx/statuskart.com/public

If you are installing under a subdomain, click on the subdomains link.(see the below image)

Fig.2.2 Domain Setup - Step-2

That will show a new window as shown below,

Fig.2.3 Domain Setup - Step-3

There you can enter the subdomain name. You have to select the domain and should enter the document root.
The /public at the end of the document root is required as in the picture.

If you are going to use an existing domain, click on the domains link in Fig.2.2
That will show a list of domains as shown below.

Fig.2.4 Domain Setup - Step-4

Then click manage button of the domain that you wish to choose. That will show a window as shown below.

Fig.2.5 Domain Setup - Step-5

Here you can edit your document root under "New Document Root" section.

Fig.2.6 Domain Setup - Step-6

Make sure that the document root ends with /public. Then you can save the changes using update button.

Step 2: Upload files

The next step is uploading the files to the server.
Hope you already know the FTP details of your server and document root.
Once you extracted the code you purchased, it’s folder structure will be as shown below.

Fig.2.7 Upload files - Step-1

Now open the src folder from the extracted file. It contains the files and folders as shown below

Fig.2.8 Upload files - Step-2

We need to upload those files to the server using FTP. After connecting to the FTP server, You will see the files in src folder on the left hand side of the window and the server folder on the right hand side of the window.

Fig.2.9 Upload files - Step-3

One important point is that, even though our document root is /home/kycdyuvx/statuskart.com/public,
we are not going to upload the files to /home/kycdyuvx/statuskart.com/public folder,
but we are uploading the files to /home/kycdyuvx/statuskart.com/ folder After all the files are uploaded, the window will looks like the picture below.

Fig.2.9 Upload files - Step-4

Step 3: Change the permission of storage folder

Now we need to change the permission of storage folder. For that, select the storage folder from the remote folder

Fig.2.10 Storage permission setup - Step-1

Then give 775 permission as shown below

Fig.2.11 Storage permission setup - Step-2

Step 4: Database setup

Now you need to create a database and a user and assign it.

Fig.2.12 Database Setup

First, create a new database for the application as shown below.

Fig.2.13 Database creation

After creating a data base, you also need to create a user as shown below.

Fig.2.14 User creation

So we created
a user: kycdyuvx_mz
and a database: kycdyuvx_mz
Now add the user to the database.

Fig.2.15 Adding user to database

After that, give all the permissions by checking "ALL PRIVILEGES" checkbox as below.

Fig.2.16 Allow permissions

After these steps are completed, take the domain URL. It will be redirected to the installation page.

Step 5: Install IMAP Extension

In order to work Email piping, php imap extension should be installed.
You can refer the below link to install php imap extension using cPanel.
Refer : Install php imap extension using cPanel

Step 6: Installation using installer

Now you have to install the Ticketing Expert using the installer. For that take the domain URL and it will be redirected to a page as shown below.

Fig.2.17 Installer

In the next step, you need to provide the database details as below.

Fig.2.18 Database details

After filling the correct db details, It will be redirected to requirement checking page in the next step as shown below. If there any requirement is left, you have to install it.

Fig.2.19 Requirements check

After checking the requirements, you have to provide the right permissions in the next step.

Fig.2.20 Permission check

If you are using cPanel installation, for providing missing right permissions, select the corresponding folders as shown below.
Otherwise run the following commands from your root folder.
chmod -R 777 storage/*
chmod -R 777 bootstrap/cache

For cPanel installation:
Fig.2.21 Permission setup for bootstrap/cache folder

After that, give 775 permissions for all required folders. Then proceed with the installation.

Fig.2.22 Give 775 permissions

Step 7: Cron setup

Now you need to setup the cron for importing latest emails to the Ticketing expert. For that take the "Cron jobs" from cPanel.

Fig.2.23 Cron setup - Step-1

Then click an add new cron button. On the displayed window, From "Common Settings", select "Once Per Five Minutes" and fill other fields as shown below.

Fig.2.24 Cron setup - Step-2

Our command to add to the cron is
/usr/local/bin/php /home/kycdyuvx/statuskart.com/artisan schedule:run >> /dev/null 2>&1"
/home/kycdyuvx/statuskart.com/ is the path to the application
So add /usr/local/bin/php /home/kycdyuvx/statuskart.com/artisan schedule:run >> /dev/null 2>&1" as the command.
Then you will see

Fig.2.24 Cron setup - Step-3

We have to add one more command to the cron, That should be run in every one minutes. Command to be added to the cron is /usr/local/bin/php /home/kycdyuvx/statuskart.com/artisan queue:work --stop-when-empty

3. Installation Using Terminal

Note: This document explains the installation of Ticketing Expert on a subdomain demo.modulespanel.com. So, you have to replace demo.modulespanl.com mentioned in each installation steps with your subdomain. In each step, we have marked the demo.modulespanl.com subdomain in red color. So, you have to replace demo.modulespanl.com in red color with your subdomain.

Step 1: Document root set-up


It’s better to install the Laravel app on a web server. You can create a sub domain for this.
Eg: demo.modulespanl.com Then you have to set up a document root for this domain.
Document root should be something like /var/www/demo.modulespanl.com/public/
If you are using apache2, you have to create a virtual host for that. For that you have to create a file like /etc/apache2/sites-available/demo.modulespanl.com.conf.
Content within your Virtual-Host tag of the page will be something like

<VirtualHost *:80>
<Directory /var/www/demo.modulespanl.com/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerAdmin webmaster@localhost
ServerName demo.modulespanl.com
ServerAlias demo.modulespanl.com
DocumentRoot /var/www/demo.modulespanl.com/public/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =demo.modulespanl.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}
END,NE,R=permanent]
</VirtualHost>


Here you can see that we defined Server Name demo.modulespanl.com and Document Root
/var/www/demo.modulespanl.com/public/

For more details on webserver set up, you can visit following links.

Linux webserver installation.
  Webserver set-up for Linux

Windows webserver installation.
  Webserver set-up for Windows

Mac Webserver installation.
  Webserver set-up for Mac OS

Step 2: Enable the subdomain

Then enable the subdomain using the below command.
a2ensite demo.modulespanel.com.conf
sudo /etc/init.d/apache2 restart

Step 3: Unzip your files

Then you have to unzip the project file you purchased. There will be two folders named as src and docs. First you have to upload the files in src folder to the folder, /var/www/demo.modulespanl.com.
Once you uploaded the files, make sure that you have folders like
/var/www/demo.modulespanl.com/app/
/var/www/demo.modulespanl.com/database/
/var/www/demo.modulespanl.com/public/

Step 4: Install php-imap

Linux installation.
We need php-imap for importing tickets from email. You can install it using the below command.
sudo apt-get install php-imap
sudo phpenmod imap
Then restart your webserver.

Windows installation.
You need to configure your php.ini file to enable IMAP extension.
To locate the php.ini file path refer link : Locate php.ini
Search for the line ;extension=php_imap.dll and remove semicolon( ; ).
The line should look like as mentioned below.
extension=php_imap.dll
Then restart your webserver.

Mac OS installation.
First of all, make sure that you have installed brew on your system. If not, please install brew by
referring the link : Install and Use Homebrew on macOS
Now you can install php-imap using the below commands on Mac OS.
brew tap kabel/php-ext
brew install php-imap
Then restart your webserver.
For more details : IMAP Mac OS installation

Step 5: Permission settings

In order to change the permissions, run the below commands from the terminal
cd /var/www/demo.modulespanl.com
chmod -R 777 storage/*
chmod -R 777 bootstrap/cache

Step 6: Clear cache

Now run the following commands
php artisan key:generate
php artisan cache:clear
php artisan config:clear

Step 7: Scheduler Set up

You have to run the below commands from the root folder of your Laravel application
php artisan schedule:run to import latest emails to the Ticketing expert.
When you run php artisan schedule:run, it will import the latest emails. Then if you run it again after 10 minutes, it will import the emails came within the last 10 minutes. The above step will work in Linux, OSX and Windows.
If you are using Linux or OSX, You can use crontab instead of running the above command. For that, run the below commands. crontab -e
then add the line
Then the scheduler will run in each 5 minutes.

Also add queue worker to the cron, which will run in every one minute. So the two cron commands are
*/5 * * * * cd /var/www/demo.modulespanl.com && php artisan schedule:run >> /dev/null 2>&1
*/1 * * * * cd /var/www/demo.modulespanl.com && php artisan queue:work --stop-when-empty
After these steps are completed, take the domain URL. It will be redirected to the installation page.

Step 8: Installation using installer:

After these steps are completed, you will be redirected to the installation page. Press below link or refer step-6 of section-2 for more about the installation using installer.
Refer: Installation using installer

NOTE: Please contact us if you face any issue with the installation. Also we provide paid installation.
Please refer the User Documentation to learn about using the application.

4. Local Installation

Note: This document explains the installation of Ticketing Expert in your local machine.
Assuming that you have already installed PHP, Apache and MySQL in your local machine. If not,please install any webserver by going through the below links. Installation depends on your OS, so use the links given for your OS.

Linux webserver installation.
  Webserver set-up for Linux (Link 1). OR
  Webserver set-up for Linux (Link 2).

Windows webserver installation.
  Webserver set-up for Windows

Mac Webserver installation.
  Webserver set-up for Mac OS

Step 1: Unzip your files

First unzip the purchased Ticketing Expert zip file in a folder. Go to the src folder in unzipped file, there you see folders like app, config, public, routes, vendor etc.
And files like .env , server.php, User_guide.pdf etc.
We assume that, the code is extracted(unzipped) to a folder /home/user/ticketing_expert . (In this case, this is your root folder of the Laravel application)

Step 2: Install php-imap

Linux installation.
We need php-imap for importing tickets from email. You can install it using the below command.
sudo apt-get install php-imap
sudo phpenmod imap
Then restart your webserver.

Windows installation.
You need to configure your php.ini file to enable IMAP extension.
To locate the php.ini file path refer link : Locate php.ini
Search for the line ;extension=php_imap.dll and remove semicolon( ; ).
The line should look like as mentioned below.
extension=php_imap.dll
Then restart your webserver.

Mac OS installation.
First of all, make sure that you have installed brew on your system. If not, please install brew by
referring the link : Install and Use Homebrew on macOS
Now you can install php-imap using the below commands on Mac OS.
brew tap kabel/php-ext
brew install php-imap
Then restart your webserver.
For more details : IMAP Mac OS installation

Step 3: Permission settings

In order to change the permissions, run the below commands from the root folder of your Laravel application.
cd /home/user/ticketing_expert
chmod -R 777 storage/*
chmod -R 777 bootstrap/cache

Step 4: Clear cache

Now run the following commands from the root folder of your Laravel application .
php artisan key:generate
php artisan cache:clear
php artisan config:clear

Step 5: Scheduler Set up

You have to run the below commands from the root folder of your Laravel application
php artisan schedule:run to import latest emails to the Ticketing expert.
When you run php artisan schedule:run, it will import the latest emails. Then if you run it again after 10 minutes, it will import the emails came within the last 10 minutes.
So, you have to run this command to import emails using IMAP.

Run php artisan queue:work --stop-when-empty in another tab Whenever you add/edit department with IMAP details, also when you reply to a IMAP ticket. In server, those should be added to cron, then you don't have to worry about those commands.

Step 6: Start application:

Then you can start the application
For that open a new tab in terminal and run the below commands from the root folder of your Laravel application
php artisan serve
Then you will see some output like
Starting Laravel development server: http://127.0.0.1:8000.
You can open this URL in any browser.

Step 7: Installation using installer:

After these steps are completed, you will be redirected to the installation page. Press below link or refer step-6 of section-2 for more about the installation using installer.
Refer: Installation using installer

NOTE: Please contact us if you face any issue with the installation. Also we provide paid installation.
Please refer the User Documentation to learn about using the application.