OTRS Installation Guide on Ubuntu (with Custom MySQL Binary)

1. System Preparation

Update system packages:

sudo apt update && sudo apt upgrade -y

Install required packages (Apache, Perl, modules, wget, unzip):

sudo apt install apache2 libapache2-mod-perl2 perl unzip libdbi-perl libdbd-mysql-perl libdbd-odbc-perl -y

Enable Apache modules needed by OTRS:

sudo a2enmod perl deflate headers filter rewrite
sudo systemctl restart apache2

2. Install and Configure MySQL (Using Custom Binary)

Assume MySQL binary is extracted at /path/mysql-8.4.3-linux-glibc2.28-x86_64.

Prepare /etc/my.cnf with:

[mysqld]
basedir=/path/mysql-8.4.3-linux-glibc2.28-x86_64
datadir=/path/mysql-8.4.3-linux-glibc2.28-x86_64/data
socket=/path/mysql-8.4.3-linux-glibc2.28-x86_64/mysql.sock
port=3306
innodb_log_file_size=512M
character-set-server=utf8
collation-server=utf8_general_ci

Start MySQL server:

cd /path/mysql-8.4.3-linux-glibc2.28-x86_64
./bin/mysqld --defaults-file=/etc/my.cnf --console &

Connect to MySQL:

./bin/mysql -uroot -p --socket=./mysql.sock

Create OTRS database and user:

CREATE DATABASE otrs CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'otrs'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON otrs.* TO 'otrs'@'localhost';
FLUSH PRIVILEGES;
EXIT;

3. Install OTRS

Download and extract OTRS:

cd /opt
sudo wget https://ftp.otrs.org/pub/otrs/otrs-latest.tar.gz
sudo tar -xzvf otrs-latest.tar.gz
sudo mv otrs-*/ otrs
sudo chown -R otrs:www-data /opt/otrs

4. Set Permissions

sudo chown -R otrs:www-data /opt/otrs
sudo /opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=otrs --web-group=www-data

5. Configure Apache for OTRS

Link OTRS Apache config:

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

Enable required Apache modules (verify):

sudo a2enmod perl deflate headers filter rewrite
sudo systemctl restart apache2

6. Configure OTRS Database Connection

Set database connection (or use web installer):

sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Set --key="DatabaseHost" --value="127.0.0.1"
sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Set --key="Database" --value="otrs"
sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Set --key="DatabaseUser" --value="otrs"
sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Set --key="DatabasePw" --value="your_password_here"
sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Set --key="DatabaseDSN" --value="DBI:mysql:database=otrs;host=127.0.0.1"

7. Initialize OTRS Database Schema

sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Database::Install

8. Start OTRS Daemons

sudo systemctl start otrs.service
sudo systemctl enable otrs.service

If no service is set up, start manually:

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

9. Access OTRS Web Interface


10. Troubleshooting

Check logs for errors:

sudo tail -f /var/log/apache2/error.log
sudo tail -f /opt/otrs/var/log/apache2.error

Common issue: missing Perl modules like DBD::mysql — install with:

sudo cpan DBD::mysql

Database connection errors?
Double-check your MySQL socket, user, password, and privileges.


Written by A.M. Rinas