OTRS (Open-Source Ticket Request System) is a free system that any institution can use to assign unique identifiers called tickets to service or information requests. Very useful in IT support departments to control and respond to requests made by users within an organization.
Originally, OTRS worked only on MySQL databases. Support has since been added for PostgreSQL, Oracle, DB2 and Microsoft SQL Server.
It’s open source.
- Thanks to the perl modules it is scalable.
- Easy to use
- It has a good security system
- flexible and controllable at all times
- It has a web frontend easy and ready to use.
Installing OTRS on Ubuntu 18.04
OTRS can be installed on various GNU/LINUX distributions and use several database managers, so the decision depends on our needs. In this tutorial we will use the combination of Ubuntu, Apache and PostgreSQL.
1.- Upgrading the system
Since a new version of an operating system is released, new security patches are released that improve the stability of the packages and the system in general, so it is recommended to start the tutorial with a system update.
:~$ sudo -i
After entering your password you will be a root user
:~# apt update && apt upgrade
2.- Installing Apache web server and PostgreSQL
OTRS has a very friendly web interface from where the system is controlled, so we must install apache and postgreSQL as the database management system.
:~# apt install apache2 libapache2-mod-perl2 postgresql
After that, we started both services.
:~# systemctl start apache2 :~# systemctl start postgresql
3.- Installing PERL modules
Now we proceed to install some PERL modules so that OTRS runs correctly. This is because it is built with Perl.
:~# apt install libdbd-pg-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl libgd-text-perl libgd-graph-perl libapache-dbi-perl libarchive-zip-perl libcrypt-eksblowfish-perl libcrypt-ssleay-perl libencode-hanextra-perl libjson-xs-perl libmail-imapclient-perl libtemplate-perl libtemplate-perl libtext-csv-xs-perl libxml-libxml-perl libxml-libxslt-perl libpdf-api2-simple-perl libyaml-libyaml-perl
When the process is finished, it is necessary to activate the PERL module for apache.
:~# a2enmod perl
And restart apache
:~# systemctl restart apache2
4.- Create a new user
It is recommended that the user running OTRS is not the root user, because this gives us more security and control over our web server.
We proceed to create a new user, for example, otrs.
:~# useradd -d /opt/otrs -c 'OTRS user' otrs
Now we add it to the www-data group which is the group that has the apache run permission.
:~# usermod -a -G www-data otrs
5.- Preparing postgreSQL and the database
First of all, we must log in to the postgreSQL console:
:~# sudo - postgres :~# psql
Now we create the user dedicated to OTRS:
create user otrs password 'otrspss' nosuperuser;
‘otrspss’ is the password, you can enter any password you want and obviously do not share it.
Now we have to create the database and give privileges to the newly created user on it.
create database otrs owner otrs;
Then we went out
Now we enable the new user’s log in, to do this we must edit the file
:~# nano /etc/postgresql/10/main/pg_hba.conf
And we edit the file to look like the image
We finally restart the postgresql service.
:~# systemctl restart postgresql
6.- Downloading OTRS
Now we can download OTRS from their servers, at the time of writing this article, their latest stable version is 6.0.
:~# cd /opt :~# wget http://ftp.otrs.org/pub/otrs/otrs-6.0.8.tar.gz
Once downloaded, we unzip it, rename the folder to a short name and finally change the owner of the folder.
:~# tar -xzvf otrs-6.0.8.tar.gz :~# mv otrs-6.0.8 otrs :~# chown -R otrs:otrs otrs
Before continuing, we must run a script that will check if all the modules are available.
As we see in the image, I am missing a module that is required, fortunately it also gives us the command to solve the mishap. In this case it is cpan DateTime
Now we run the script again.
we can now see that we meet all the requirements. The missing modules are optional.
Now we proceed to copy the necessary settings for the execution.
:~# cd /opt/otrs/ :~# cp Kernel/Config.pm.dist Kernel/Config.pm
The following will be editing the configuration file and in changing the database, removing mysql support and supporting postgreSQL
Next, we must enable PostgreSQL support in apache and perl.
:~# nano scripts/apache2-perl-startup.pl
Inside the file, we just uncomment the following lines:
# enable this if you use postgresql
use DBD::Pg ();
Save the changes and exit.
Now we check that all dependencies and modules are correctly loaded and configured.
:~# 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
And if when executing each of the commands, we receive a “Syntax OK”. Everything’s on track.
Now we proceed to import a sample database into postgreSQL.
:~# su - postgres :~# cd /opt/otrs/
:~# psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs
:~# psql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrs
:~# psql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrs
7.- Starting OTRS
We set the permissions to the group that runs apache
:~# /opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=www-data --web-group=www-data
Let’s then make a symbolic link from the virtualhost configuration created to the apache configuration file
:~# ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
we finally enabled virtualhost and restarted apache.
:~# a2ensite otrs :~# systemctl restart apache2
8.- Testing the installation
Now we can enter the web browser, with the server IP and the orts path. To log in by default with root@localhost and as root key.
And then we can go on to create a new ticket
We can say that the variety of OTRS configurations makes it a powerful and versatile software ideal to fulfill the task of supporting the users of an organization.
Please share this article through your social networks