8.6 C
Texas
angeloma
Senior Writer and partner

How to install the lastest OTRS on Ubuntu 18.04?

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.

- Advertisement -
:~$ sudo -i

After entering your password you will be a root user

:~# apt update && apt upgrade

1.- Upgrading the system
1.- Upgrading the system

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

2.- Installing apache and postgresql
2.- Installing apache and postgresql

After that, we started both services.

:~# systemctl start apache2
:~# systemctl start postgresql

3.- Starting services
3.- Starting services

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

4.- Installing perl modules
4.- Installing perl modules

When the process is finished, it is necessary to activate the PERL module for apache.

:~# a2enmod perl

And restart apache

:~# systemctl restart apache2

5.- Enabling perl modules for apache
5.- Enabling perl modules for apache

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

6.- creating new user
6.- creating new user

5.- Preparing postgreSQL and the database

First of all, we must log in to the postgreSQL console:

:~# sudo - postgres
:~# psql

7.- PostgreSQL shell
7.- PostgreSQL shell

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;

8.- Creating databases
8.- Creating databases

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

9.- Editing postgresql con file
9.- Editing postgresql conf file

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

10.- Downloading otrs
10.- Downloading otrs

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

10.- getting the folder
10.- getting the folder

Before continuing, we must run a script that will check if all the modules are available.

:~# /opt/otrs/bin/otrs.CheckModules.pl

11.- Checking perl modules
11.- Checking perl modules

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

12.- cpan datetime
12.- cpan datetime

Now we run the script again.

13.- Re checking
13.- Re checking

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

14.- Copying configurations
14.- Copying configurations

The following will be editing the configuration file and in changing the database, removing mysql support and supporting postgreSQL

15.- editing configuration
15.- editing configuration

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;

16.- Startup apache perl
16.- Startup apache perl

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.

17.- Checking modules
17.- Checking modules

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

18.- copying sample database
18.- copying sample database

:~# psql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrs

 

19.- Copying sample database
19.- Copying sample database

And finally:

:~# psql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrs

20.- Copying sample database
20.- Copying sample database

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

21.- Virtualhost apache
21.- Virtualhost apache

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/

22.- Logging otrs web interface
22.- Logging otrs web interface

23.- Main panel ORTS
23.- Main panel ORTS

And then we can go on to create a new ticket

24.- Creating a new ticket
24.- Creating 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

 

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

12 COMMENTS

  1. 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

  2. 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

  3. 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.

  4. 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

  5. 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?

  6. 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

  7. /opt/otrs$ psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs =============>scripts/database/otrs-schema.postgresql.sql: Permission non accordée

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article