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.
:~# /opt/otrs/bin/otrs.CheckModules.pl
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 ();
use Kernel::System::DB::postgresql;
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/
and write:
:~# 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
And finally:
:~# 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.
http://IP_SERVER/orts/
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
Hi,
First of all thank you so much for this detailed guide!
I did every step but I keep getting this error on the login page…
Backend ERROR: OTRS-CGI-10 Perl: 5.26.1 OS: linux Time: Fri Aug 3 10:36:54 2018
Message: FATAL: password authentication failed for user “otrs”
FATAL: password authentication failed for user “otrs”
RemoteAddress: 192.168.87.121
RequestURI: /otrs/
Traceback (932):
Module: Kernel::System::Web::InterfaceAgent::Run Line: 184
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32
install
apt-get install libnet-smtp-perl
and edit /etc/resolv.conf, removing the original contents and replacing it with:
Code: Select all
nameserver 8.8.8.8
nameserver 8.8.4.4
Try again
Hi,
Thank you for the comment, I found out what was the problem.
I didn’t input the password in the kernel file….silly me.
Now it works.
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
Csomaglisták olvasása… Kész
Függőségi fa építése
Állapotinformációk olvasása… Kész
libsoap-lite-perl csomag nem elérhető, de egy másik hivatkozik rá.
A kért csomag hiányzik, elavult vagy csak más forrásból érhető el
libcrypt-ssleay-perl csomag nem elérhető, de egy másik hivatkozik rá.
A kért csomag hiányzik, elavult vagy csak más forrásból érhető el
E: Ez a csomag nem található: libdbd-pg-perl
E: Ez a csomag nem található: libpdf-api2-perl
E: „libsoap-lite-perl” csomagnak nincs telepítésre jelölt verziója
E: Ez a csomag nem található: libapache-dbi-perl
E: Ez a csomag nem található: libcrypt-eksblowfish-perl
E: „libcrypt-ssleay-perl” csomagnak nincs telepítésre jelölt verziója
E: Ez a csomag nem található: libencode-hanextra-perl
E: Ez a csomag nem található: libjson-xs-perl
E: Ez a csomag nem található: libmail-imapclient-perl
E: Ez a csomag nem található: libtext-csv-xs-perl
E: Ez a csomag nem található: libxml-libxslt-perl
E: Ez a csomag nem található: libpdf-api2-simple-perl
I’ve follow this guide, all works fine, but I cannot login into otrs.
“Login failed! Your user name or password was entered incorrectly.”
I tried using different users and passwords but none can logon.
¿What could be missing?
Hi
Great article thnaks; How do we install SSL and the redirection from 80 to 443 ?
Thanks
In starting OTRS part
instead of this
ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
execute this
sudo ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf-enabled/zzz_otrs.conf
Internal Server Error ????
check your system resources!
how ? and thank you
/opt/otrs$ psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs =============>scripts/database/otrs-schema.postgresql.sql: Permission non accordée
Hello. I Have 2 questions:
1. When I try to test: http://192.168.1.84/otrs
I see such error:
Not Found
The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at 192.168.1.84 Port 80
I unziped files from gzip, and rename folder.
When I try to open http://192.168.1.84/ its all ok (Apache congratulates me)