Installation on Debian 5.04 lenny

From OtterHub - OTRS Community Wiki
Jump to: navigation, search


This article describes the installation of OTRS on Debian 5.04 ("Lenny"). For other versions, installation would be probably similar. If you feel this article can be better, please edit it!


We'll install OTRS in the directory /opt; all applications we install manually, and NOT via the package manager, should go there.

  • Download the .tar.gz 'source' file from
  • open a root shell or do 'sudo su -'
  • extract the archive and move it to /opt
tar xf otrs-2.4.*.tar.gz
mv otrs-2.4.* /opt/otrs

The next step is to install the necessary Perl modules, the web server and the database.

aptitude install libapache2-mod-perl2 libdbd-mysql-perl libtimedate-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libdbd-mysql-perl libsoap-lite-perl libgd-text-perl libtext-csv-xs-perl libjson-xs-perl libgd-graph-perl libapache-dbi-perl mysql-server

Of course you can also run the database on a remote host, or use for instance PostgreSQL as the database. While still pretty straight-forward, it's outside of the scope of this document.

Now you should create a user under which the OTRS cron jobs and such are running. The user should be added to the webserver group, and has /opt/otrs as the home directory.

useradd -r -d /opt/otrs/ -c 'OTRS user' otrs
usermod -g www-data otrs

Now you have to prepare the OTRS configuration file. Copy the file in /opt/otrs/ to so you have your own brand new copy, do the same for the file /opt/otrs/Kernel/Config/

cd /opt/otrs/Kernel
cp Config/ Config/

Now you need to set the permissions so both the web server user and the OTRS user have permissions on the directory. For this you can use the supplied script:

cd /opt/otrs
bin/ --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs

Web server configuration

OTRS has a bundled default configuration file for Apache. You should add this to the Apache configuration directory, and then restart the server in order to get going:

cp /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf.d/otrs.conf
/etc/init.d/apache2 restart

Web installer

Go to with your web browser. Here you can create the database to be used for OTRS (use the MySQL root password you set earlier), as well as do some other basic configuration. After this, you can log in to OTRS with the default account root@localhost and password root.

Now you have created the database, edit the file /opt/otrs/scripts/ - we need that in order to configure Apache::DBI. Apache::DBI is not a module that is really needed for OTRS but it will pre-establish database connections, which will be better for performance. Therefore it' s recommended to set it up. Besides that, it's really easy to set up, so why not..?

Just simply remove the pound signs (#) before the lines for Apache::DBI and fill in the password you just created for the OTRS database using the web installer. If you forgot what it was, please just look up the value for $Self->{'DatabasePw'} in the file /opt/otrs/Kernel/

use Apache::DBI ();
Apache::DBI->connect_on_init('DBI:mysql:otrs', 'otrs', 'my-secret-pass');
use DBI ();

OTRS cron jobs

OTRS uses several cron jobs for time-based actions, such as escalating tickets, sending out reminders, fetching emails from POP and IMAP boxes, and so on. You'll have to prepare these cronjobs so they are run by the OTRS user.

cd /opt/otrs/var/cron
for foo in *.dist; do cp $foo `basename $foo .dist`; done # copies all files with .dist extension to regular name

Now we have to add them to the otrs user's crontab:

cd /opt/otrs
bin/ start otrs

Now the cron jobs are scheduled and will be executed on pre-defined intervals.

You can check with the command crontab -l -u otrs if the entries for the OTRS user are set up correctly.

After this, you can log in to OTRS via with the default account root@localhost and password root. Now, you can log in to OTRS, create users, configure incoming and outgoing email, and the like. As they say... ((enjoy))!