An updated version of this article using OTRS 5 and Ubuntu 16.04 is available here.
This article describes how to install the OTRS help desk system on an Ubuntu 12.04 server. OTRS is a popular open-source help desk system written in Perl; it was at version 3.2.9 as of this writing. The instructions here should work for later versions of Ubuntu or Debian, but you should RTFM for later versions of OTRS to take advantage of new features.
Ubuntu 12.04 provides packages for OTRS 2 (apt-get install otrs2), but we want the latest version, so we have to download the source.
For this procedure I used a standard 64-bit Ubuntu 12.04 LTS machine image on an Amazon Web Services EC2 instance, but it should work for any standalone Ubuntu box.
The OTRS Installation Process
1) On your server, install the basic services:
(If you’re using AWS, you could use a LAMP appication stack from a provider like Bitnami, but we’ll start from scratch.)
$ apt-get update $ 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:
(The latest is 3.2.9 as of this writing.)
$ wget http://ftp.otrs.org/pub/otrs/otrs-3.2.9.tar.gz $ tar -xvzf otrs-3.2.9.tar.gz -C /opt/otrs
3) Check to see if all prerequisites are installed:
$ cd /opt/otrs $ bin/otrs.CheckModules.pl
The script reports the following missing required Perl modules:
LWP::UserAgent Apache2::Reload Net::DNS Net::SMTP::SSL Net::SMTP::TLS::ButMaintained YAML::XS
And some missing recommended Perl modules (we’ll ignore the additional database connectors and mail handlers for now):
GD JSON::XS PDF::API2 Text::CSV_XS XML::Parser
4) Install the missing Perl modules:
$ apt-get install liblwp-useragent-determined-perl libapache2-mod-perl2 libnet-dns-perl libnet-smtp-ssl-perl libnet-smtp-tls-butmaintained-perl libyaml-perl
$ apt-get install libgd-text-perl libjson-xs-perl libpdf-api2-perl libtext-csv-xs-perl libxml-parser-perl
5) Create your OTRS user and add them to your webserver group:
$ useradd -d /opt/otrs/ -c 'OTRS user' otrs $ usermod -G www-data otrs
6) Create your default OTRS config files:
$ cd /opt/otrs/ $ cp Kernel/Config.pm.dist Kernel/Config.pm $ cp Kernel/Config/GenericAgent.pm.dist Kernel/Config/GenericAgent.pm
7) Check one last time for any missing Perl dependencies:
$ perl -cw /opt/otrs/bin/cgi-bin/index.pl /opt/otrs/bin/cgi-bin/index.pl syntax OK $ perl -cw /opt/otrs/bin/cgi-bin/customer.pl /opt/otrs/bin/cgi-bin/customer.pl syntax OK $ perl -cw /opt/otrs/bin/otrs.PostMaster.pl /opt/otrs/bin/otrs.PostMaster.pl syntax OK
8) Set the file permissions for your OTRS directory:
$ bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=www-data --otrs-group=www-data --web-group=www-data /opt/otrs $ ls -al /opt/otrs (owner/group should read otrs: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:
$ ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs $ a2ensite otrs $ 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.
11) Go to http://yoursite/otrs/index.pl and log in using the default username and password:
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:
$ 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:
$ for foo in *.dist; do cp $foo `basename $foo .dist`; done
Still as the otrs user, start cron and verify it’s running:
$ /opt/otrs/bin/Cron.sh start $ crontab -l
Finally, enjoy your new OTRS installation!