OTRS Installation (5.0.11) on Ubuntu 16.04

This article describes how to install the latest open source OTRS help desk system on an Ubuntu 16.04 server. If you’ve used my previous article, the procedure is little changed from before, but some of the specific commands are different. As of this writing, the current version of OTRS is 5.0.11, and I’m starting with a bare install of Ubuntu 16.04 Server.

Ubuntu 16.04 offers OTRS 5.0.7 in its repos, but if you want the latest patch level, we have to install from source.

The OTRS Installation Process

1) On your server, install the basic services:

root@ubuntu:/# apt-get update
root@ubuntu:/# apt-get install apache2 mysql-server

Be sure to give your MySQL install a strong root password when prompted.

At this point you may also want to delete any test users or databases included with MySQL.

Also remember to ensure your firewall (probably ufw if you’ve installed one) is allowing inbound connections on TCP/80. If you’re using Amazon EC2, remember to open TCP/80 inbound in your instance or VPC security group.

2) Download and untar the latest OTRS source:

root@ubuntu:/# wget http://ftp.otrs.org/pub/otrs/otrs-5.0.11.tar.gz
root@ubuntu:/# tar -xvzf otrs-5.0.11.tar.gz -C /opt/otrs

3) Check to see if all prerequisites are installed:

root@ubuntu:/# /opt/otrs/bin/otrs.CheckModules.pl

Not surprisingly, we’re missing a few required and many recommended Perl modules:

  o Apache::DBI......................FAILED! Not all prerequisites for this module correctly installed.
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v2.04)
  o Archive::Zip.....................Not installed! Use: 'apt-get install -y libarchive-zip-perl' (required - Required for compressed file generation.)
  o Crypt::Eksblowfish::Bcrypt.......Not installed! Use: 'apt-get install -y libcrypt-eksblowfish-perl' (optional - For strong password hashing.)
  o Crypt::SSLeay....................Not installed! Use: 'apt-get install -y libcrypt-ssleay-perl' (optional - Required for Generic Interface REST transport and SOAP SSL connections.)
  o Date::Format.....................ok (v2.24)
  o DBI..............................Not installed! Use: 'apt-get install -y libdbi-perl' (required)
  o DBD::mysql.......................Not installed! Use: 'apt-get install -y libdbd-mysql-perl' (optional - Required to connect to a MySQL database.)
  o DBD::ODBC........................Not installed! Use: 'apt-get install -y libdbd-odbc-perl' (optional - Required to connect to a MS-SQL database.)
  o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
  o DBD::Pg..........................Not installed! Use: 'apt-get install -y libdbd-pg-perl' (optional - Required to connect to a PostgreSQL database.)
  o Encode::HanExtra.................Not installed! Use: 'apt-get install -y libencode-hanextra-perl' (optional - Required to handle mails with several Chinese character sets.)
  o IO::Socket::SSL..................Not installed! Use: 'apt-get install -y libio-socket-ssl-perl' (optional - Required for SSL connections to web and mail servers.)
  o JSON::XS.........................Not installed! Use: 'apt-get install -y libjson-xs-perl' (optional - Recommended for faster AJAX/JavaScript handling.)
  o List::Util::XS...................ok (v1.41)
  o LWP::UserAgent...................ok (v6.13)
  o Mail::IMAPClient.................Not installed! Use: 'apt-get install -y libmail-imapclient-perl' (optional - Required for IMAP TLS connections.)
    o IO::Socket::SSL................Not installed! Use: 'apt-get install -y libio-socket-ssl-perl' (optional - Required for IMAP TLS connections.)
  o ModPerl::Util....................Not installed! Use: 'apt-get install -y libapache2-mod-perl2' (optional - Improves Performance on Apache webservers dramatically.)
  o Net::DNS.........................Not installed! Use: 'apt-get install -y libnet-dns-perl' (required)
  o Net::LDAP........................Not installed! Use: 'apt-get install -y libnet-ldap-perl' (optional - Required for directory authentication.)
  o Template.........................Not installed! Use: 'apt-get install -y libtemplate-perl' (required - Template::Toolkit, the rendering engine of OTRS.)
  o Template::Stash::XS..............Not installed! Use: 'apt-get install -y libtemplate-perl' (required - The fast data stash for Template::Toolkit.)
  o Text::CSV_XS.....................Not installed! Use: 'apt-get install -y libtext-csv-xs-perl' (optional - Recommended for faster CSV handling.)
  o Time::HiRes......................ok (v1.9726)
  o Time::Piece......................ok (v1.29)
  o XML::LibXML......................Not installed! Use: 'apt-get install -y libxml-libxml-perl' (optional - Required for Generic Interface XSLT mapping module.)
  o XML::LibXSLT.....................Not installed! Use: 'apt-get install -y libxml-libxslt-perl' (optional - Required for Generic Interface XSLT mapping module.)
  o XML::Parser......................Not installed! Use: 'apt-get install -y libxml-parser-perl' (optional - Recommended for faster xml handling.)
  o YAML::XS.........................Not installed! Use: 'apt-get install -y libyaml-libyaml-perl' (required - Very important)

4) Install the missing Perl modules:

I’m including all the required modules and most performance-related recommended modules.

root@ubuntu:/# apt-get install libarchive-zip-perl libdbi-perl libdbd-mysql-perl libnet-dns-perl libtemplate-perl libyaml-libyaml-perl libtext-csv-xs-perl libapache2-mod-perl2 libjson-xs-perl

5) Create your OTRS user and add them to your webserver group:

root@ubuntu:/# useradd -d /opt/otrs -c 'OTRS user' otrs
root@ubuntu:/# usermod -G www-data otrs

6) Create your default OTRS config file:

root@ubuntu:/# cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm

7) Check one last time for any missing Perl dependencies:

root@ubuntu:/# perl -cw /opt/otrs/bin/cgi-bin/index.pl
/opt/otrs/bin/cgi-bin/index.pl syntax OK

root@ubuntu:/# perl -cw /opt/otrs/bin/cgi-bin/customer.pl
/opt/otrs/bin/cgi-bin/customer.pl syntax OK

root@ubuntu:/# perl -cw /opt/otrs/bin/otrs.Console.pl
/opt/otrs/bin/otrs.Console.pl syntax OK

8) Set the file permissions for your OTRS directory:

root@ubuntu:/# /opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=www-data --web-group=www-data

9) Register OTRS with Apache:

There are various ways to do this, but I just added a symbolic link from /etc/apache2/sites-available to /opt/otrs/scripts/apache2-httpd.include.conf:

root@ubuntu:/# ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
root@ubuntu:/# a2ensite otrs
root@ubuntu:/# service apache2 restart

10) Go to http://yoursite/otrs/installer.pl and set up your database and mail system.

Your MySQL root password was established in step 1 above, but the email and local otrs database are up to you. OTRS wanted a couple of changes to the MySQL defaults:

root@ubuntu:/# vi /etc/mysql/mysql.conf.d/mysqld.cnf
# change max_allowed_packet
max_allowed_packet = 20M
# add innodb_log_file_size
innodb_log_file_size = 512M

11) Make note of your database and OTRS root user passwords. Then go to http://yoursite/otrs/index.pl and log in using the default username and password:

User: root@localhost
Password: as above

Go into Admin -> Agents in the Dashboard, add some authenticated users (“Agents”), and change the password for root@localhost to something stronger.

12) If you want your OTRS help desk to be your default web site — i.e., the OTRS login page appears at http://yoursite/ — you might have a look at Part II Step 5 here.

13) Start the OTRS Cron Jobs:

Change to the OTRS user you created in step 5:

root@ubuntu:/# sudo su otrs

Go into /opt/otrs/var/cron and copy any *.dist file for which you want a cron job to its base name without the “.dist”, i.e., “postmaster.dist” is copied to “postmaster”. If you want to copy all of them, you can do this:

otrs@ubuntu:/# for foo in *.dist; do cp $foo `basename $foo .dist`; done

Still as the otrs user, start cron and verify it’s running:

otrs@ubuntu:/# /opt/otrs/bin/Cron.sh start
otrs@ubuntu:/# crontab -l

Finally, enjoy your new OTRS installation!

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *