Friday 18 July 2014

OSTicket in CentOS 6.4

OsTicket is a widely-used and trusted open source support ticket system.
It seamlessly routes enquiries created via email, web-forms and phone calls into a simple, easy-to-use, multi-user, web-based customer support platform.
osTicket comes packed with more features and tools than most of the expensive (and complex) support ticket systems on the market.
The best part is, it's completely free.


OsTicket's core features not only rival, but also exceed most high-priced help desk solutions


Custom Fields
Customize the data collected from users when submitting a ticket to help get straight to the issue.

Rich Text HTML
Rich text or HTML email, is supported and allows for rich text markup in staff replies and internal notes posted to the ticket thread.

Ticket Filters
Define rules to route incoming tickets to the right departments or staff members, and action triggers.

Help Topics
Configurable help topics for web tickets. Route inquiries without exposing internal departments or priorities.

Agent Collision Avoidance
Ticket locking mechanism to allow staff to lock tickets during response and avoid conflicting or dual responses.

Assign and Transfer
Transfer tickets between departments to make sure it's being handled by the correct staff. Assign tickets to a staff or to a team.

Auto-Responder
Configurable automatic reply sent out when a new ticket is opened or a message is received.

Internal Notes
Add internal notes to tickets for staff. Activity logs let you see events or actions that have been taken, when they took place, and by whom.

Service Level Agreements
SLA Plans allow you to track tickets and due dates without the hassle.

Customer Portal
All support requests and responses are archived online. User can login using email and ticket ID. No user account or registration required to submit a ticket.

Dashboard Reports
Get system overview and basic historical statistics on tickets count and status per department, staff and help topics.










Installation of OsTicket

Note: I had compile Apache & php in /opt


----------------------------------------------------------------------------------------
1) Stop unwanted Services or settings
----------------------------------------------------------------------------------------
# /etc/init.d/NetworkManager stop
# chkconfig NetworkManager off
Note: Make sure you have configured Network i.e. (IP Address/Netmask/Gateway/DNS)

# /etc/init.d/sendmail stop
# chkconfig sendmail off
# vi /etc/sysconfig/selinux
SELINUX=disabled

----------------------------------------------------------------------------------------
2) Open Necessary Ports in iptables
----------------------------------------------------------------------------------------
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
#/etc/init.d/iptables restart
#chkconfig iptables on

----------------------------------------------------------------------------------------
3) Download and install Additional YUM repositories
----------------------------------------------------------------------------------------
#mkdir  /softwares
#cd  /softwares
#wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
#rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


----------------------------------------------------------------------------------------
4) Install Dependencies
----------------------------------------------------------------------------------------

#yum install glibc glibc-common
#yum install gcc-*
#yum install zlib-*
#yum install openssl-*
#yum install libxml2-devel    (Require to compile PHP)
#yum install gdbm-devel        (GDM Library for PHP)


----------------------------------------------------------------------------------------
5) Create osticket database and configure
----------------------------------------------------------------------------------------

#/etc/init.d/mysqld start
#chkconfig mysqld on
#mysqladmin -u root password YOUR-PASSWORD
#mysql -u root -p


mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'YOUR-PASSWORD' WITH GRANT OPTION;
mysql> create database osticket;
mysql> create user osticket IDENTIFIED BY 'osticket';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'osticket'@'%' IDENTIFIED BY 'osticket' WITH GRANT OPTION;
mysql> GRANT ALL ON osticket.* TO 'osticket'@'localhost' IDENTIFIED BY 'osticket' WITH GRANT OPTION;
mysql> quit


#lsof -i :3306


----------------------------------------------------------------------------------------
6) Download and install Install Aapache
----------------------------------------------------------------------------------------

#cd /softwares
#wget http://archive.apache.org/dist/httpd/httpd-2.2.25.tar.gz
#tar -zxvf httpd-2.2.25.tar.gz
#cd httpd-2.2.25

#./configure --prefix=/opt/apache --enable-mods-shared=all --enable-so --enable-cgi --enable-proxy --enable-headers --enable-expires --enable-vhost-alias --enable-info --enable-rewrite --enable-speling    --enable-usertrack --enable-deflate --enable-ssl --enable-mime-magic

#make

#make install

#vi /opt/apache/conf/httpd.conf
Listen 80
User apache
Group apache

#/opt/apache/bin/apachectl -k restart

#rm -rf /softwares/httpd-2.2.25


----------------------------------------------------------------------------------------
7) Download and install Install PHP
----------------------------------------------------------------------------------------
#yum install mysql mysql-server
#yum install gd
#yum install libpng
#yum install libjpeg
#yum install php-gd
#yum install libpng-devel
#yum install libjpeg-devel
#yum install libXpm-devel
#yum install libmcrypt-*
#yum install uw-imap*    Note:  this package is available at  wget ftp://rpmfind.net/linux/epel/5/x86_64/uw-imap-2007e-14.el5.x86_64.rpm
#yum install libc-client
#yum install libc-client-devel
#yum install pam-devel



----------------------------------------------------------------------------------------
8) Install imap to suport php-imap extention
----------------------------------------------------------------------------------------

> Note in CentOS 6 you need to compile imap php support seperatly to do so use following script

# vi setup-imap.sh

#!/bin/sh
# Script for PHP-IMAP installation. 0.1b
# Written by Martynas Bendorius (smtalk)

CWD=`pwd`
OS=`uname`

#Is it a 64-bit OS?
B64=0
   
B64COUNT=`uname -m | grep -c 64`
if [ "$B64COUNT" -eq 1 ]; then
    B64=1
    LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
    export LD_LIBRARY_PATH
fi

if [ ! -e /usr/include/krb5.h ] && [ -e /etc/redhat-release ]; then
    echo "Installing krb5-devel"
    yum -y install krb5-devel
fi

VERSION=2006k
URL="ftp://ftp.cac.washington.edu/imap/old/imap-${VERSION}.tar.Z"
FILENAME=imap-${VERSION}
TARBALL=${FILENAME}.tar.Z

echo "Downloading ${TARBALL}..."
wget -O ${TARBALL} ${URL}
tar xzf ${TARBALL}
cd ${FILENAME}

echo "Installing ${FILENAME}..."

if [ ${OS} = "FreeBSD" ]; then
    if [ ${B64} -eq 0 ]; then
        make bsf
    else
        make bsf EXTRACFLAGS=-fPIC
    fi
else
    perl -pi -e 's#SSLDIR=/usr/local/ssl#SSLDIR=/etc/pki/tls#' src/osdep/unix/Makefile
    perl -pi -e 's#SSLINCLUDE=\$\(SSLDIR\)/include#SSLINCLUDE=/usr/include/openssl#' src/osdep/unix/Makefile
    perl -pi -e 's#SSLLIB=\$\(SSLDIR\)/lib#SSLLIB=/usr/lib/openssl#' src/osdep/unix/Makefile
    if [ ${B64} -eq 0 ]; then
        make slx
    else
        make slx EXTRACFLAGS=-fPIC
    fi
fi

echo "Copying files to /usr/local/php-imap"
mkdir -p /usr/local/php-imap/include
mkdir -p /usr/local/php-imap/lib
chmod -R 077 /usr/local/php-imap
cp -f c-client/*.h /usr/local/php-imap/include/
cp -f c-client/*.c /usr/local/php-imap/lib/
cp -f c-client/c-client.a /usr/local/php-imap/lib/libc-client.a
cd ..
rm -rf ${FILENAME}

exit 0;
------------------------------------------------------------------------------------------------------

#chmod +x setup-imap.sh

#./setup-imap.sh

----------------------------------------------------------------------------------------
9) Download and Install php with mysql + apache support
----------------------------------------------------------------------------------------


#cd /softwares

#wget http://us2.php.net/get/php-5.5.5.tar.gz/from/in1.php.net/mirror
#tar -zxvf php-5.5.5.tar.gz
#cd php-5.5.5


Node: following configuration parameter would install gd extention support also.

#./configure --prefix=/opt/apache/php --with-apxs2=/opt/apache/bin/apxs --enable-cli --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-config-file-path=/opt/apache/php --with-mysql=/opt/mysql --with-xmlrpc --without-pear --with-gd --with-jpeg-dir=/opt/apache/php --with-png-dir=/opt/apache/php --with-mcrypt --with-mcrypt --with-zlib --with-gettext --with-gdbm  --enable-pdo  --with-pdo-mysql --with-imap=/usr/local/php-imap  --with-imap-ssl --with-kerberos  --with-openssl
#make
#make install
#cp /softwares/php-5.5.5/php.ini-production /opt/apache/php/php.ini



Edit php.ini & Check following

1: short_open_tag
2: date.timezone


#vi /opt/apache/php/php.ini

short_open_tag = On



#vi /opt/apache/php/php.ini

date.timezone = Asia/Kolkata




#vi /opt/apache/conf/httpd.conf

#++++++++PHP+++++++++++
# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module modules/libphp4.so
#AddHandler php-script  .php
# Use for PHP 5.x:
#LoadModule php5_module  modules/libphp5.so
AddHandler php5-script  .php
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType text/html       .php
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
#++++++++++PHP+++++++++++++++

#/opt/apache/bin/apachectl -k restart

#/opt/apache/bin/httpd -M | grep php
Syntax OK
php5_module (shared)

#rm -rf  /softwares/php-5.5.5




----------------------------------------------------------------------------------------
10) Download and install Install OSTicket
----------------------------------------------------------------------------------------

#cd /softwares

#wget http://osticket.com/dl/osTicket-v1.7.2.zip
OR
#wget https://github.com/osTicket/osTicket-1.7/releases/download/v1.7.3/osTicket-v1.7.3.zip


# unzip osTicket-v1.7.2.zip

# mkdir /opt/osticket/

# cp  -r /softwares/upload/* /opt/osticket/

#chown -R  apache.apache /opt/osticket/

#vi /opt/apache/conf/httpd.conf

### OS Ticket ###
Alias /ticket /opt/osticket
<Directory /opt/osticket/>
Options Indexes
AllowOverride none
DirectoryIndex index.php
Order allow,deny
allow from all
</Directory>

#/opt/apache/bin/apachectl -k restart


http://SERVER-IP/ticket
http://LOCALHOST/ticket
http://127.0.0.1/ticket


#Fill all the required Setting i.e Name, Email ID & all.

#Also Fill the Database setting i.e DBName,DBUser,DBPassowrd & Click on Install


# cp /opt/osticket/include/ost-sampleconfig.php /opt/osticket/include/ost-config.php
# chown apache.apache /opt/osticket/include/ost-config.php





# chmod 664 /opt/osticket/include/ost-config.php
# rm -rf /opt/osticket/setup/

Note: We have mapped helpdesk.linuktricks.com A Record in My DNS
Go to installer program and follow the instructions:

----------------------------------------------------------------------------------------
11) Empty /opt/apache/conf/extra/httpd-vhosts.conf file
----------------------------------------------------------------------------------------

#> /opt/apache/conf/extra/httpd-vhosts.conf


#vi /opt/apache/conf/extra/httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin devendra.joshi@linuktricks.com
    DocumentRoot /opt/osticket
    ServerName helpdesk.linuktricks.com
    ErrorLog "logs/ticket-error_log"
    CustomLog "logs/ticket-access_log" common
</VirtualHost>


#vi /opt/apache/conf/httpd.conf
Include conf/extra/httpd-vhosts.conf

#/opt/apache/bin/apachectl -k restart

#mkdir /opt/osticket/attachment
#chown apache.apache /opt/osticket/attachment
#chmod 777 /opt/osticket/attachment





Note :For HT Password : http://www.htaccesstools.com/htpasswd-generator/


No comments:

Post a Comment