Gentoo, otrs, apache and mod_perl [Part 2]

I will now detail the steps on how I got OTRS working using mod_fastcgi instead of mod_perl.

1 – mod_fastcgi

Setting this up is rather straightforward.

  • emerge -av mod_fastcgi
  • Add -D FASTCGI to your APACHE2_OPTS in ”/etc/conf.d/apache2″

A little tweak will be needed in the apache module script that will be added.
Since we’ll be adding fast-cgi’d perl scripts, we’ll want mod_fastcgi to handle the .fpl extention.

  • Add .fpl to the extension list in /etc/apache2/modules.d/20_mod_fastcgi.conf

2 – Getting OTRS

You might need to unmask OTRS from portage. I went all out and unmasked all versions. If you don’t live on the edge and don’t take the OTRS guys at their word for their stability, you might want to lock the unmask to a version.

  • Add <=www-apps/otrs-2.1.2 ~x86 to /etc/portage/package.keywords (create the file if it ain’t there). Of course, I’m assuming you’re running x86 and the package is masked.
  • Add <=dev-perl/Crypt-PasswdMD5-1.3 ~x86 to /etc/portage/package.keywords. It is needed as well. And there’s no OTRS without unmasking that one.
  • Make sure you have the fastcgi use flag set in your make.conf or for OTRS in package.use. This’ll make sure the OTRS fastcgi-compatible scripts (.fpl) are available.
  • emerge -av otrs

3 – Installing OTRS web-app

For reasons beyond understanding, the OTRS package uses webapp-config, but just doesn’t respect the standard structure.
You will need to install OTRS under a subpath, but don’t use the OTRS path. Why? Well, no mater what subpath you choose, OTRS will be unstalled under /otrs. A redirection will be set at the path of your choosing to bring it to OTRS. Don’t ask me.

  • webapp-config -I otrs 2.1.2 -d tracker

Of course, use your own version and use your own path. I chose “tracker”.
When you upgrade OTRS, you’ll be able to redo this step. Just use -U instead of -I.

OTRS is now partially setup. webapp-config gave you nice indications on what to do next. I’ll just go on with my indications.

We’ll create symbolic links for the new otrs setup. We’ll use this because it’ll save alot of tweaking with settings later on.

You might notice that OTRS is installed under /var/www/localhost/otrs-2.1.2. We’ll create a symbolic link that will make this /var/www/localhost/otrs this way, you’ll be able to switch versions and not worry about paths and whatnot.

  • cd /var/www/localhost
  • ln -s otrs-2.1.2 otrs
  • cd otrs
  • ln -s /usr/share/webapps/otrs/2.1.2/htdocs htdocs

If you’re updating and you just changed your symbolic links, restart apache as well. It seems that not everything notices that the link has changed.

4 – Adding OTRS to Apache

We’ll now add otrs to your apache config. I’ll assume you are running using the default virtual host and that you’ll be able to translate whatever is below onto your own setup.

  • Open up /etc/apache2/vhosts.d/00_default_vhost.conf
  • Add index.fpl to your virtualhost’s DirectoryIndex statement (or wherever you want to put your OTRS)
  • Add the following in your virtualhost:

Alias /otrs-web/ “/var/www/localhost/otrs/htdocs/”
ScriptAlias /otrs/ “/var/www/localhost/otrs/bin/fcgi-bin/”

<Directory “/var/www/localhost/otrs/bin/fcgi-bin/”>

   AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all


<Directory “/var/www/localhost/otrs/htdocs/”>

   AllowOverride None
Order allow,deny
Allow from all


Yes, you need both aliases. No, I don’t know if you can easily use other names.

You can restart your apache now. The engine is almost ready to run.

5 – Setting up the Cron jobs

Otrs wants to run cron jobs. Otrs wants to run under its own user. You want to help OTRS work.

If you are updating, you’ll want to go through these again.

These steps will set the proper rights. To folder and otrs user.

  • chown -R otrs:apache /var/www/localhost/otrs-2.1.2
  • chmod -R gu+w /var/www/localhost/otrs-2.1.2
  • chown -R otrs:apache /var/www/localhost/otrs-2.1.2/htdocs/*
  • chmod -R gu+w /var/www/localhost/otrs-2.1.2/htdocs/*
  • usermod -s /bin/bash -d /var/www/localhost/otrs -G cron otrs

Time for some Cron Fu. These steps will copy the cron tasks at their rightful place

  • cd /var/www/localhost/otrs/var/cron
  • for foo in `ls -1 *.dist` ; do cp $foo `basename $foo .dist`; done
  • su otrs
  • cd ~/bin
  • ./ start
  • crontab -e

You’re now staring at the otrs crontab. Update what needs to be updated in there:

  • update MAILTO
  • uncomment proper fetchmail command. Do so by removing the pound (#) symbol in front of the line you want to use. If you don’t know which, use the first one.
  • save the crontab
  • exit from su.

6 – OTRS first config

  • Point your browser to http://localhost/otrs/installer.fpl
  • Follow the instructions there

When you’re done, you are ready for your first login:

  • Point your browser to http://localhost/otrs/index.fpl
  • Username: root@localhost
  • Password: root

And you are on your own from there.

I don’t have all the steps for updates. I guess there would be database update scripts to run as well.

Hopefully, this is well documented enough to help people in need to press forward.

3 thoughts on “Gentoo, otrs, apache and mod_perl [Part 2]

  1. hi everybody,
    everything is very well documented, but i’ve still a problem, because i can’t find "installer.fpl" in my system.
    i’m using otrs 2.1.5 on gentoo 2.6.18; apache 2.0.59; mysql 4.1.22.
    the only files i’ve found in /fcgi-bin are customer.fpl, index.fpl and public.fpl.
    Nothing else
    could you support us, what we’ve to do to get the installer.fpl
    thx in advance

  2. I had not noticed that an fpl version of installer was not distributed…

    I had gone through the install process while running in plain CGI (or mod_perl, I can’t remember) – I only switched to fcgi afterwards…

    This is most likely what you’ll need to do as well.

  3. i m tryin 2 configure otrs with mod_perl cos m runnin crm sw on my sys which is gettin conflicted wid otrs so hw it can b solvd??

Comments are closed.