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.
ln -s otrs-2.1.2 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/”
Options +ExecCGI -Includes
Allow from all
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
for foo in `ls -1 *.dist` ; do cp $foo `basename $foo .dist`; done
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
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.