How To Install OTRS on AlmaLinux 8

Install OTRS on AlmaLinux 8

In this tutorial, we will show you how to install OTRS on AlmaLinux 8. For those of you who didn’t know, OTRS stands for “Open Source Trouble Ticket System” is a free and open-source service management suite. It is written in the PERL programming language and its ability to integrate with other systems makes it much more popular. OTRS has a low requirement which makes it ideal for small business ticketing.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the OTRS (Open Ticket Request System) on an AlmaLinux 8. You can follow the same instructions for CentOS and Rocky Linux.

Prerequisites

  • A server running one of the following operating systems: AlmaLinux 8, CentOS, and Rocky Linux 8.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo useror access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install OTRS on AlmaLinux 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf clean all
sudo dnf update
sudo dnf install epel-release
sudo dnf config-manager --set-enabled powertools
sudo dnf install gcc expat-devel procmail mod_perl perl perl-core sharutils

Step 2. Installing Apache Web Server and MariaDB.

Now we install the Apache webserver and MariaDB database server to your system using the following command:

sudo dnf install httpd mariadb-server

Once the installation is complete, start to enable it to start on system start-up using:

sudo systemctl start httpd mariadb
sudo systemctl enable httpd mariadb

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log in to the MariaDB console and create a database for the OTRS. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for OTRS installation:

MariaDB [(none)]> CREATE DATABASE otrs character set UTF8 collate utf8_bin;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON otrs.* TO 'otrs'@'localhost' IDENTIFIED BY 'your-strong-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

After that, OTRS requires that you change the following settings:

nano /etc/my.cnf.d/mariadb-server.cnf

Add the following lines:

max_allowed_packet=256M
character-set-server=utf8
collation-server=utf8_general_ci
innodb_buffer_pool_size=4G
innodb_log_file_size=1G

Save and close the file, then restart the MariaDB service to apply the changes:

sudo systemctl restart mariadb

Step 3. Create an OTRS user and Permission.

First, create a dedicated user for OTRS using the following command below:

useradd otrs
usermod -G apache otrs

Step 4. Installing OTRS on AlmaLinux 8.

By default, OTRS is not available on the AlmaLinux 8 base repository. Now we run the following command to download the latest version of OTRS to your system:

wget https://otrscommunityedition.com/download/otrs-community-edition-6.0.33.zip

Next, unzip the downloaded file :

unzip otrs-community-edition-6.0.33.zip
mv otrs-community-edition-6.0.33 /opt/otrs

There are a couple of Perl modules required to extend the functions of OTRS. Hence to check what are those we can use a script available in the OTRS extracted folder:

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

Step 5. Configure OTRS.

Default config files In /opt/otrs. Now we rename the configuration file with the following command:

cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm

Next, edit the configuration file with the following command:

nano /opt/otrs/Kernel/Config.pm

Define your database settings:

# The database name
$Self->{Database} = 'otrs';

# The database user
$Self->{DatabaseUser} = 'otrs';

# The password of database user. You also can use bin/otrs.Console.pl Maint::Database::PasswordCrypt
# for crypted passwords
$Self->{DatabasePw} = 'your-strong-password';

Save and close the file then edit the Apache Perl configuration file and define the name of your database:

nano /opt/otrs/scripts/apache2-perl-startup.pl

Uncomment the following lines:

use DBD::mysql ();
use Kernel::System::DB::mysql;

Save and close the file then verify all configuration files using the following command below:

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

Next, apply appropriate permissions to files:

/opt/otrs/bin/otrs.SetPermissions.pl

Step 5. Configure Apache.

By default, OTRS includes a pre-built template in the OTRS directory to use as an Apache. You can copy it to the Apache configuration directory using the following command:

ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/httpd/conf.d/otrs.conf

Next, restart the Apache service to apply the changes:

sudo systemctl restart httpd

After that, start the OTRS daemon with the following command:

sudo -u otrs /opt/otrs/bin/otrs.Daemon.pl start

Step 6. Configure Firewall.

AlmaLinux comes with Firewalld enabled by default, and it will block other connections from other computers that are trying to access our OTRS service. We must open the appropriate ports so that the OTRS resources can be accessed from other machines:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Step 7. Accessing OTRS Web Interface.

Once successfully installed, open your web browser and access the OTRS using the URL http://you-server-ip-address/otrs/installer.pl. You will be redirected to the following page:

Install OTRS on AlmaLinux 8

Congratulations! You have successfully installed OTRS. Thanks for using this tutorial for installing the OTRS (OpenSource Trouble Ticket System) on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official OTRS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!