Install OTRS on Ubuntu 16.04 with Apache

OTRS on Ubuntu 16.04

Introduction

OTRS (Open-Source Ticket Request System) is a web-based ticketing system, widely used by businesses for services like customer support, help desks and call centres. The software is separated into several parts, the main section being the OTRS framework, which contains all central functions for the application and the ticket system; it is possible to integrate it with modules, Network Monitoring tools, FAQs, etc.
It has a lot of features, including:

  • A powerful and customizable agent dashboard with personal ticket overviews and graphical statistics support
  • An extensible reporting engine provides various statistics, reports and scheduling options
  • Built-in rights management that can be extended with fine-grained access control lists
  • OTRS uses Tickets to gather all external and internal communication that belongs together. These tickets are organized in queues
  • Tickets can be linked to other tickets or other objects such as FAQ entries
  • A powerful search engine that allows complex and full-text searches on tickets

OTRS offers paid business solutions, but also offers a free version.
This tutorial demonstrates the installation of OTRS Help Desk on an Ubuntu 16.04 server.

Getting started

First of all, install MariaDB on the server:

# apt install mariadb-server

Then, execute:

# mysql_secure_installation

Enter a password for the root account, and then:

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y 
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

OTRS require that you change the following settings:

In

/etc/mysql/my.cnf

, under the [mysqld] section, paste:

max_allowed_packet   = 20M
query_cache_size     = 32M
innodb_log_file_size = 256M

Start MariaDB with systemd:

# systemctl start mysql

If you want MariaDB to start up at boot time:

# systemctl enable mysql

Install OTRS

On to the next step. Now it’s time to download and install OTRS, building from source code. Download the code archive.
Extract with tar:

$ tar xpf otrs-5.0.16.tar.bz2

Move the extracted directory into

/opt

, renaming it in

otrs
# mv otrs-5.0.16 /opt/otrs

Check if the system contains all required PERL modules, executing the command:

$ perl /opt/otrs/bin/otrs.CheckModules.pl

Eventually, install required modules with apt (as suggested by the script).

Create a OTRS user

Create a user for OTRS:

# useradd -d /opt/otrs -c 'OTRS user' otrs

and add it to the webserver group:

# usermod -G www-data otrs

Default config files

In

/opt/otrs

, execute the following command:

# cp Kernel/Config.pm.dist Kernel/Config.pm

With this step, you’ll activate a “default” config file.

Check installed modules and configure Apache

Just execute the commands:

# perl -cw /opt/otrs/bin/cgi-bin/index.pl
# perl -cw /opt/otrs/bin/cgi-bin/customer.pl
# perl -cw /opt/otrs/bin/otrs.Console.pl

If the response is “syntax OK” for all, it means that the Perl modules have been installed successfully.

Next, install the Apache web server and mod_perl, using apt:

# apt install apache2 libapache2-mod-perl2

In

/opt/otrs

there is a configuration file for Apache. Link it to the webserver configuration directory:

# ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf-enabled/zzz_otrs.conf

OTRS requires a few Apache modules to be active for optimal operation. Enable with:

# a2enmod perl
# a2enmod version
# a2enmod deflate
# a2enmod filter
# a2enmod headers

Restart the webserver, so it will load new configurations:

# systemctl restart apache2

Modify file permissions

It is required to adjust file permissions, to allow OTRS to read and write files. In

/opt/otrs

:

# bin/otrs.SetPermissions.pl --web-group=www-data

Basic configuration

Using the web installer at http://localhost/otrs/installer.pl, setup database and basic system settings such as email accounts.
1
Click on “Next”. Accept the GNU AGPL, and then:
2
Configure OTRS for accessing MySQL:

3

Next, you’ll be asked for some personal information like your email account, your business info, etc.

At the end of this process, it’s possible to login to the system at this URL: http://localhost/otrs/index.pl with the credentials configured in the installer.