Skip to content

Instantly share code, notes, and snippets.

@jakobii
Last active April 12, 2017 16:08
Show Gist options
  • Save jakobii/bb196be3d05d04c2c643dfaa209e7f3a to your computer and use it in GitHub Desktop.
Save jakobii/bb196be3d05d04c2c643dfaa209e7f3a to your computer and use it in GitHub Desktop.
ost-doc.md

Install osTicket

enter image description here

This documentation shows you how to install and configure osTicket v1.10 (901e5ea) on Ubuntu 16.04
updated 4/11/2017

Install all the things

once you have done the initial install of Ubuntu 16.04, Connect to the machine over ssh. then run the following commands. this will install all required dependencies. you will be prompted to set the root password for the Mysql database.

sudo apt -y update && sudo apt -y full-upgrade 
sudo apt -y install mysql-server apache2 libapache2-mod-php php php-mcrypt php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-imap php-intl php-apcu snmp php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc

Secure Mysql with the following command. this will prompt you with questions, you can decide how secure you want to be.

Mysql_secure_installation

Clone osTicket and setup file directory

git clone https://github.com/osTicket/osTicket /var/www/osticket

Setup Apache2 vhost for HTTPS

Customize the path to your SSL certificates to fit your needs. Copy the certificate to somewhere that is secure but where the webserver can reach it.

sudo mkdir /PATH/TO/CERT # you could use /etc/ssl/osticket
sudo cp /CERTS/FOLDER /PATH/TO/CERT

Create a Apache2 config file of osTicket.

sudo nano /etc/apache2/sites-available/osticket.conf

Copy and paste the following text into osticket.conf. customize domain and certificate paths according to your environment. Press ctrl+x then y to exit and save that the file when finished.

<VirtualHost *:80>
	ServerName YOUR.DOMAIN.NAME
	Redirect "/" "https://YOUR.DOMAIN.NAME/"
</VirtualHost>
<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerName YOUR.DOMAIN.NAME
		ServerAdmin [email protected]
		ServerAlias WWW.YOUR.DOMAIN.NAME
		DocumentRoot /var/www/osticket
		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
		SSLEngine on
		SSLCertificateFile /PATH/TO/CERT
		SSLCertificateKeyFile /PATH/TO/KEY
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>
	</VirtualHost>
</IfModule>

Enable the apache2 vhost

You now need to enable the Apache2 SSL module to enable HTTPS on the webserver.

sudo a2enmod ssl
sudo a2ensite osticket.conf
sudo systemctl restart apache2

Ready to Go!

navigate to https://YOUR.DOMAIN.NAME/support/setup/

If you get to the OST installer page, read and follow the onscreen instructions it will instruct you what commands to run in the terminal, and when to run them. when you are finished, osTicket will suggest you remove the setup folder. run the command below to do so.

sudo rm -R /var/www/osticket/setup

Understanding osTicket

Departments

‘Departments’ are one of the main reasons why I chose to stick with osTicket over any other ticket system. It vital that you understand how they work before you make changes to them.

Deparments admin web page: https://YOUR.DOMAIN.NAME/scp/departments.php

‘Departments’ in osTicket control what tickets an agent can view. They also control which agents a ticket can be assigned to. When a ticket is generated by osTicket it has to be assigned to a department. A ticket can not be created without being assigned to a department. You can create filters to control which tickets get assigned to which departments(more info about filtering later), otherwise the ticket will be automatically assigned to the default department. The default department in osTicket is created for you. You can not delete the default department, but you can change its name and settings to fit your needs. You can find the department easily, it is marked by ‘(default)’. Departments support nesting but it is really only useful one level deep.

Examples

To understand all of that, let consider some examples:

Let say you create two departments ‘IT’ and ‘Facilities’. If a tickets gets assigned to the ‘IT’ department only agents who have access to the department can view its tickets. The reverse is also true.

Agemt Name Department Viewable Tickets Description
Agent1 IT 30 Can only view IT tickets
Agent2 Facilities 15 Can only view Facilities tickets
Agent3 IT & Facilities 45 Can view both IT and Facilities tickets

On the homepage of the agent panel there is a count of all the open tickets. This total open tickets that is displayed to the agent on the homepage is determined by the departs the agent has access to. From the example above If Agent1 logs in he would see a total of 30 open tickets. If Agent3 logs in he would see a total of 45 open tickets because he is a member of both departments.

Nesting Departments

You can nest departments within other department and create complex work flows and access hierarchies. Unfortunately though access is only extended one level deep ParentDepartment\ChildDepartment. Although osTicket allows you to set child departments within other child departments, an agent would only be able to see tickets assigned to child departments not the grandchild departments. This feature will hopefully be fixed in the future.

For example, if and agent is given access to a parent department:

can view tickets can view tickets can't view tickets can't view tickets
ParentDepartment ChildDepartment GrandChildDepartment GreatGrandChildDepartment

Assigning tickets

Although this is fairly straightforward it's worth explaining. An agent's ability to view a ticket is not the same as an agent's ability to claim the ticket (assign it to himself). An agent can have view access to a child department by being a member of a parent department, but if the agent is not a direct member of the child department he will not be able to claim tickets within child department. The agents name will not appear in the dropdown menu list for ticket assignment. This feature will hopefully be fixed in the future.

This means you can not use department nesting for agents that need tickets assigned to them. Agents automatically have view rights to direct child departments. but in order for them to be able to claim tickets in the child departments you need to make them direct members, by either setting the department as their primary or extended department in the ‘access’ panel of the agents settings.

Agent admin web page: https://YOUR.DOMAIN.NAME/scp/staff.php

Teams

I recommend you avoid using osTicket teams for now. they're super broken/underdeveloped and totally not worth the headache.

Ticket Filtering

Ticket Filters are the bread an butter of osTicket. Filters help you automate which agents get assigned to which tickets. They can also help to block unwanted tickets based on specific strings, this is helpful when you get a lot of spam email. If you get good at this you can sit back and relax and let osTicket do the work for you. Here are some things I found helpful.

If you end us needing 100 ticket filters like I do. try your best to always use the 'Match All' criteria option. This will save you a lot of head aches and make it easier to find where a ticket filter is failing.

Make use of the 'Topic ID' as matching criteria. This is not as straight forward to do but its totally worth it. Install something like phpMyadmin on the osticket server and you will be able to view the osticket database. in the table named YOUR-DB-PREFIX_help_topic you can find the help topic id's for each help topic you've created. This will help greatly when trying to use the 'Match All' criteria option. Hopefully the ability to view help topic ID's will be added to osTicket in a future release. until then this is the work around.

Alternitively you can run this SQL command in a Mysql terminal. you will need to change to table name to whatever database prefix you chose at the installation of osTicket.

SHOW DATABASES; -- this will help you find your database name
USE YOUR-OSTICKET-DB; -- replace with your datebase name
SHOW TABLES;  -- this will help you find the help_topic table
SELECT topic_id,topic FROM `YOUR-DB-PREFIX_help_topic`; -- replace with your table name 

If you use the web form in osTicket, make use of custom forms and lists. These features basically lets you create your own tables in Mysql that can store any kind of information you want, you can then use these features to build out your help topic' forms. Not only does this make your web forms super customizable but you can then use them to further hone in on exactly how you want your tickets to filter by adding those custom lists as matching criteria.

closing notes

Ill update as i see fit but i hope this helps.

Happy Hacking
Jacob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment