0% found this document useful (0 votes)
229 views25 pages

OsTicket WINstall

This document provides instructions for installing osTicket, an open source help desk ticketing system, on a Windows system using Xampp. It describes downloading and installing Xampp to satisfy system prerequisites for osTicket like PHP, MySQL, and a web server. It then guides the user through downloading and installing osTicket, configuring the database, and making some optional customizations. Recommended modifications like enabling an HTML email template and auto-filling fields with canned responses are also described.

Uploaded by

Matt Anderson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
229 views25 pages

OsTicket WINstall

This document provides instructions for installing osTicket, an open source help desk ticketing system, on a Windows system using Xampp. It describes downloading and installing Xampp to satisfy system prerequisites for osTicket like PHP, MySQL, and a web server. It then guides the user through downloading and installing osTicket, configuring the database, and making some optional customizations. Recommended modifications like enabling an HTML email template and auto-filling fields with canned responses are also described.

Uploaded by

Matt Anderson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

osTicket Windows Install Guide

May 2, 2013 Corporate, Software, Windows

I spent more time than I care to admit trying to setup and configure the latest version of osTicket during
the last week or so, having zero background experience with Apache, Mysql or PHP just made it all the
more challenging. So I thought I would create the following documentation to help Simplify the install
process for new users. I will be updating the Mods section as time allows to Detail my current MOD
setup. Please Let me know if you have any questions along the way!

1.7 Install Guide

Before we can begin installing osTicket, First we have to satisfy the following Pre-requisites:

- PHP 4.4 ( or higher )


- MySQL 4.4 ( or higher )
- Web Server of choice ( Apache, ISS, hosted, etc )

Ive found the simplest way to accomplish this, Is by using Xampp. Essentially Xampp is our All-in-One
solution for satisfying all of the above Pre-requisites for osTicket.

Download and Install Xampp. Selecting the following Components.


When the Install has Finished. Open your Xampp Control Panel (C:\xampp\xampp-control.exe)

Now Start the Apache & MySQL Services.


Additional Notes:

* You may encounter installation issues if you are installing Xampp to a machine that has had or
currently has PHP or MySQL installed. I highly recommend un-installing any versions of MYSQL or PHP
before Starting your install.

* PHP in this package needs the Microsoft Visual C++ 2008 Redistributable package from
http://www.microsoft.com/en-us/download/details.aspx?id=5582.

If Port Conflict Occurs for Apache.

Open up Command Prompt and Type netstat -aon . Take Note of the PID #.

Now Open Task Manager > Processes. Sort by PID #. ( If you dont see PID, You need to select it @ View
> Columns )

If you are able to safely disable it, You can do so by Going to Run and typing Services.msc. If Port 80 is
being used by a legitimate source, You can change the Port that Apache uses. ( Although I recommend
using Port 80 if possible! )

Under the Apache Module Select Config > Apache (httpd.conf)

Once Open Find the Following Section of Code and Change the default Port #80

#Listen 0.0.0.0:80
#Listen [::] :80
Listen 82

If apache service Starts Fine Continue to Installing osTicket

Installing osTicket

Download osTicket @ http://osticket.com/downloads.php


1.) Un-compress the .zip File
2.) Create a Folder in C:\xampp\htdocs\ for osTicket ( This will be used to browse to your site, so
choose something appropriate ex = Helpdesk, Support, osTicket )
3.) Copy the Contents of the upload Folder from osTicket-1.7.0 to your newly created Folder
C:\xampp\htdocs\helpdeskname

4.) Now we have to Configure the Username & PW for MySQL ( default = root, no password ).
Browse to http://yourdomain.com/security/. You should See the Below Page.
Select your Language > Then Browse to http://localhost/security/xamppsecurity.php
Change the Password for MySQL & Set PHPMyadmin Authentication to http

Then Create a username and Password to Secure our XAMPP Directory.

When you are Done, Verify your Security Settings.

Now Go Back to your Xampp Control Panel and Restart the MySQL service.

5.) Now Browse to http://yourdomain.com/osTicket. You should See the Below Page.
Follow the instructions on Screen to Finish the Install.
6.) While optional, I recommend running your Apache & MYSQL as Services. This will allow you to access
your ticketing system when logged off of the Host machine as well as give you the on failure options
for Services. (R-Click My Computer > Mange > Services R-Click Service > Properties > Recovery Tab )
Configuring osTicket

Customize the Look of osTicket

To Change the Default osTicket Images Replace The following .png files

Admin / Staff Page Logo


C:\xampp\htdocs\oTicket\scp\images\ost-logo.png

Admin / Staff Page Login


C:\xampp\htdocs\oTicket\scp\images\login-logo.png

User Page Logo


C:\xampp\htdocs\oTicket\assets\default\images\logo.png

Enable Screenshots via MailFetch

Admin Panel > Tickets > Add .PNG to accepted Attachments.

Change Default Allowable Phone Format for New Tickets -


http://osticket.com/forums/showthread.php?t=718

Open up include/class.validator.php in your Favorite PHP Editor.

Change Function "_Phone" to meet your desired requirements

Change Ticket Priority Color:

1.) Browse to http://yourdomain.com/phpmyadmin

2.) Locate your ost_Ticket_Priority Table.

3. Change the HTML Color Code as desired.

Disable TAB Select on J-query Searches ( So Tab does what you would expect it to do!! )

*In scp\js\bsn.AutoSuggest_2.1.3.js
*Comment Out Line 98 = //var TAB = 9;

Setting up a Virtual Host in Apache

* This is purely a quality of Life change But It Means the difference between your users having to
remember & Type the following

http://whdintranet01/osticket/ vs. Helpdesk

*First You must setup a Forward Lookup Zone on your DNS Server.

*Modify your hosts.ini File to represent your server name. Your server name must match your DNS
entry from the previous step! ( C:\windows\system32\drivers\etc )

*Then you will need to Modify your httpd-vhosts.conf File by adding the following section of Code.
Located @ C:\xampp\apache\conf\extra\

<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot C:\xampp\htdocs\osTICKET
ServerName Helpdesk
<Directory C:\xampp\htdocs\osTICKET>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

*Finally, You will need to Restart your Apache Service in the XAMP Control Panel for these changes to
take affect.

Enable i-map E-mail Fetching


Open your Xmapp Control Panel.

Under the Apache Module Select Config > PHP(php.ini)

Once open Uncomment the following code:

Extension=php_imap.dll

Additional Notes:

*You may need to enable the Microsoft Exchange Imap4 Service on your Exchange CasArray /
Exchange Servers for this service to work.

Recommended osTicket Mods

[/expand]

HTML Template MOD:

This modification no longer functions properly in the latest version of OS-ticket, the code below is for
reference only!!! Please see the forum link below!

Login to PHPmyadmin > Select osTicket DB.

Run SQL command:

PgSQL
ALTER TABLE `ost_config` ADD

1 ALTER TABLE `ost_config` ADD `html_email_template` TEXT NULL DEFAULT NULL

include/class.config.php Add @ ~ line 548

PHP

function getHtmlEmailTemplate()
return $this->config['html_e
}

1 function getHtmlEmailTemplate(){ //BSK Retrieve HTML email template

2 return $this->config['html_email_template'];

3 }

Then Add the Following around Line 733

PHP

.',html_email_template='.db_inpu

1 .',html_email_template='.db_input($vars['html_email_template']) // BSK Update


HTML email template

include/class.email.php
Add after //do some cleanup

PHP

$htmlbody = str_replace('%mes
1 $htmlbody = str_replace('%message', str_replace("\n", '<br />', $body), $cfg-
>getHtmlEmailTemplate());

Then Add the following after $mime->setHTMLBody($htmlbody);

PHP

if (strpos($cfg->getHtmlEmailTe
$mime->setHTMLBody($h

1 if (strpos($cfg->getHtmlEmailTemplate(), '%message') !== false) //BSK If %message is


found in the HTML email template, create HTML body MIME part
2
$mime->setHTMLBody($htmlbody);

include/staff/settings-emails.inc.php

After Line 104 Add

PHP

<tr>
<th>HTML Email Template:</th><
<td><textarea row s="15" nam
</tr>

1 <tr>

2 <th>HTML Email Template:</th><?php //BSK HTML email template ?>

3 <td><textarea rows="15" name="html_email_template"


style="width:600px;"><?=$config['html_email_template']?></textarea><br><i>Will be
4
used for all outgoing emails.<br />Insert %message where you want the message text
to be replaced in the template.</i></td>

</tr>

Open class.ticket.php and comment out the following lines of code: ( x5 total )

PHP
//if($cfg->stripQuotedReply() &&
// $msg['body'] ="\n$tag\n\n".$

1 //if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))

2 // $msg['body'] ="\n$tag\n\n".$msg['body'];

This will Make sure that the Reply Separator does not get included twice on Replies.

Link to Forum Post: http://osticket.com/forum/discussion/9535/updated-for-1-7-html-email-


template#latest

Auto-Fill For frequently asked Questions:

*This is a EveryDay-Tech Original :). You can download the Modded Files HERE.

This MOD leverages the Canned responses system to automatically populate the subject & issue field
along with the already auto-Filled Response field on newly created staff tickets. This MOD adds a
subject & issue text field to the Canned response Area so you can quickly Populate these fields for
common issues!! ( autofill password resets anyone? )

Ive added the Changes below if you would like to modify the files yourself, otherwise you can find the
Altered Files in the Zip file Above. You can do a search for //RJS in the Modded Files to find out
exactly what was changed.

MyPHPAdmin

PgSQL

ALTER TABLE `ost_canned_res


ALTER TABLE `ost_canned_res

1 ALTER TABLE `ost_canned_response` ADD `subject` TEXT NULL DEFAULT NULL

2 ALTER TABLE `ost_canned_response` ADD `issue` TEXT NULL DEFAULT NULL

include/class.canned.php
Below ,response=.db_input($vars['response']).

PHP
',subject='.db_input($vars['subje
',issue='.db_input($vars['issue']

1 ',subject='.db_input($vars['subject']). //RJS

2 ',issue='.db_input($vars['issue']). //RJS

and add

PHP

function getSubject() {
return $this->ht['subject'];
} //RJS

1 function getSubject() {

2 return $this->ht['subject'];

3 } //RJS

5 function getIssue() {

6 return $this->ht['issue'];

7 } //RJS

include/staff/cannedresponse.inc.php Line 73 ish ADD

PHP

<br><br><div><b>Subject</b><
<input type="text" size="70" nam

<br><br><div><b>Issue:</b> <f

1 <br><br><div><b>Subject</b><span class="error">*&nbsp;<?php echo


$errors['subject']; ?></span></div>
2
<input type="text" size="70" name="subject" value="<?php echo $info['subject'];
3
?>">
4

5 <br><br><div><b>Issue:</b> <font class="error">*&nbsp;<?php echo $errors['issue'];


?></font></div>

<textarea name="issue" cols="21" rows="12" style="width: 80%;"><?php echo


$info['issue']; ?></textarea>

scp/js/scp.js Line 190 Add lines commented with //RJS

PHP

//Canned response.
if(canned.response) {

if($('#append',fObj).is(':checked

1 //Canned response.

2 if(canned.response) {

4 if($('#append',fObj).is(':checked') && $('#response',fObj).val())

5 $('#response',fObj).val($('#response',fObj).val()+"\n\n"+canned.response+"\n");

7 else

8 $('#response',fObj).val(canned.response);

9 $('#subject',fObj).val(canned.subject); // RJS

10 $('#issue',fObj).val(canned.issue); //RJS

Include/staff/Ticket-open.inc.php Line 216 / 219 ish

Add to existing Text Fields for Subject & issue

PHP

id="issue"
id="subject"
1 id="issue"

2 id="subject"

Link to Forum Post: http://osticket.com/forums/showthread.php?p=39871#post39871

Auto-Fill Fields on New Ticket:

*This is a EveryDay-Tech Original :). You can also download the Modded Files HERE.

This Mod Uses the Auto-fill Feature that is already present in the base install that populates Email &
User name. Our aim here is to Automatically pull in the users phone number and any additional user
related fields that you may have added to your install. You may notice that my install has an additional
field called pcname, if you are interested in adding any additional fields please see the MOD below by
Ntozier.

include/ajax.users.php

PHP

$limit = isset($_REQUEST['l
$users=array();

$sql='SELECT DISTINCT em

1 $limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit']:1;

2 $users=array();

4 $sql='SELECT DISTINCT email, name, pcname, phone'

5 .' FROM '.TICKET_TABLE

6 .' WHERE email LIKE \'%'.db_input(strtolower($_REQUEST['q']), false).'%\' '

7 .' ORDER BY created DESC'

8 .' LIMIT '.$limit;

10 if(($res=db_query($sql)) && db_num_rows($res)){

11 while(list($email,$name,$pcname,$phone)=db_fetch_row($res)) {

12 $users[] = array('email'=>$email, 'name'=>$name, 'pcname'=>$pcname,


'phone'=>$phone, 'info'=>"$email - $name - $pcname - $phone");
13
14 }

scp/js/scp.js Line 316

PHP

/* Typeahead user lookup */


$('#email.typeahead').typeahe
source: function (typeahea
if(query.length > 2) {

1 /* Typeahead user lookup */

2 $('#email.typeahead').typeahead({

3 source: function (typeahead, query) {

4 if(query.length > 2) {

5 $.ajax({

6 url: "ajax.php/users?q="+query,

7 dataType: 'json',

8 success: function (data) {

9 typeahead.process(data);

10 }

11 });

12 }

13 },

14 onselect: function (obj) {

15 var fObj=$('#email.typeahead').closest('form');

16 if(obj.name)

17 $('#name', fObj).val(obj.name);

18 if(obj.pcname)

19 $('#pcname', fObj).val(obj.pcname);
20 if(obj.phone)

21 $('#phone', fObj).val(obj.phone);

22 },

Link to Forum Post: http://osticket.com/forums/showthread.php?p=39128#post39128

Add Custom Fields MOD:

Ntoziers Guide to Add Custom Fields: http://www.tmib.net/adding-custom-text-fields-tickets

Reporting MOD:

Scottro Forum Link: http://osticket.com/forums/showthread.php?p=40058#post40058


Scottro Website MOD Link: http://sudobash.net/ostickets-reports/

Assign Ticket to Staff who Created it:

\include\staff\ticket-open.inc.php

Then add the following Code:

PHP

1 /* This sets the default as the staff member that created the ticket.*/

2 <?

3 $default=$thisstaff->getId();

4 $defaultname=$thisstaff->getName();

5 ?>

6 <option value="<?=$default?>"
selected="selected"><?=$defaultname?></option>

Link to Forum Post: http://osticket.com/forums/showthread.php?p=39195#post39195

Auto-complete by Searching Full Name Field

This Mod essentially replicates the Search functionality that is already present in 1.7st for the e-mail
field for the Full name field. I have some pretty picky co-workers and they wanted to be able to search
by first and last name! ( our email format is [email protected], so the email field search wasnt
cutting it )

In any case Ive documented my changes below for those of you who want to MOD your files manually.
Ive commented all my changes with my initials RJS to make searching for Modded section of code
just a bit easier.

include\staff\ticket-open.inc.php
Search for Full Name: and Make the following changes.

PHP

<input type="text" size="50" nam

1 <input type="text" size="50" name="name" id="name" class="typeahead"


value="<?php echo $info['name']; ?>" autocomplete="off" autocorrect="off"
autocapitalize="off"> <!--RJS-->

scp\js\scp.js
Add the Following function

PHP

/* Name Typeahead user lookup


$('#name.typeahead').typeah
source: function (typeahea
if(query.length > 1) {

1 /* Name Typeahead user lookup - RJS */

2 $('#name.typeahead').typeahead({

3 source: function (typeahead, query) {

4 if(query.length > 1) {

5 $.ajax({

6 url: "ajax.php/names?q="+query,

7 dataType: 'json',

8 success: function (data) {


9 typeahead.process(data);

10 }

11 });

12 }

13 },

14 onselect: function (obj) {

15 var fObj=$('#name.typeahead').closest('form');

16 if(obj.email)

17 $('#email', fObj).val(obj.email);

18 if(obj.pcname)

19 $('#pcname', fObj).val(obj.pcname);

20 if(obj.phone)

21 $('#phone', fObj).val(obj.phone);

22 },

23 property: "name"

24 });

scp\ajax.php
After Line 55 Add.

PHP

url_get('^/names$', array('ajax.n

1 url_get('^/names$', array('ajax.names.php:UsersAjaxAPI', 'search')), //RJS

Create The following File - include\ajax.names.php

PHP

<?php
/*************************************
ajax.names.php
1 <?php

2 /********************************************************************
*
3
ajax.names.php
4

5
AJAX interface for user names(based on submitted tickets)
6
XXX: osTicket doesn't support user accounts at the moment.
7

8
Peter Rotich <[email protected]>
9
Copyright (c) 2006-2013 osTicket
1
0 http://www.osticket.com

1
1
Released under the GNU General Public License WITHOUT ANY WARRANTY.
1
See LICENSE.TXT for details.
2

1
3 vim: expandtab sw=4 ts=4 sts=4:
1
4
Updated for Full Name Search by: Rionoskae
1
5 *********************************************************************
*/
1
6

1 if(!defined('INCLUDE_DIR')) die('403');
7

1 include_once(INCLUDE_DIR.'class.ticket.php');
8

1
9 class UsersAjaxAPI extends AjaxController {

2
0 /* Search by Full Name - RJS */
2 function search() {
1

2
if(!isset($_REQUEST['q'])) {
2
Http::response(400, 'Query argument is required');
2
3 }
2
4
$limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit']:20;
2
5 $users=array();

2
6 $sql='SELECT DISTINCT name, pcname, phone, email'
2 .' FROM '.TICKET_TABLE
7
.' WHERE name LIKE \'%'.db_input(strtolower($_REQUEST['q']), false).'%\' '
2
8 .' ORDER BY created DESC'

2 .' LIMIT '.$limit;


9

3 if(($res=db_query($sql)) && db_num_rows($res)){


0
while(list($name,$pcname,$phone,$email)=db_fetch_row($res)) {
3
1 $names[] = array('name'=>$name, 'pcname'=>$pcname, 'phone'=>$phone,
'email'=>$email, 'info'=>"$email - $name - $pcname - $phone");
3
2 }

3 }
3

3
return $this->json_encode($names);
4

3
5 }

3 }
6

3
?>
7
3
8

3
9

4
0

4
1

4
2

4
3

4
4

4
5

4
6

4
7

4
8

4
9

5
0

5
1

5
2

5
3
Forum Link: http://osticket.com/forum/discussion/9807/mod-autocomplete-by-searching-full-name-
field-on-new-tickets#latest

You might also like