It just so happened that I had need for a trouble ticket resolution system, and is my wont, turned to the open source community first. Where of course I found OTRS. OTRS is a full fledged trouble ticket resolution system, perhaps a little more than I actually net, but I decided to install it and take it for a test run anyway. I was expecting to install it this morning and spend the afternoon testing it out, but unfortunately that’s not what happened. Instead I literally spent all afternoon from around noon until 5pm installing and configuring it but not because OTRS itself is buggy but rather because the Ubuntu package available through the Ubuntu Software Center is. So let’s just start there.
I installed a fresh install of Ubuntu 10.04 on my service laptop this morning and had made no modifications to it, outside of allowing the six updates that were available to install, before beginning the OTSR installation. Canonical’s has posititioned the Ubuntu Software Center as the primary means for users to install new software and so I sought there first for an OTSR package. There was, and after reading ‘more information’ for OTSR and finding no further instructions, I installed it. That was just the beginning of the ordeal today as I quickly found that installing OTSR did not install any of the dependent packages along with it, with the single exception of Postfix. From the official documentation:
On Ubuntu, you simply open a package manager, search for the application that you want and click a button to install it. Removing an application is just as simple.
…
Some packages depend on other packages being installed in order to work. For example, a word processing package may require a printing package to be installed. The package manager automatically installs these dependencies for you.
It’s what I was expecting yet the official Canonical package didn’t install Apache2, Mysql (to be fair PostgreSQL was already installed but I chose MySql during the OTSR installation), or required Perl modules. So when OTSR got to the step in it’s installation where it would attempt to configure the database it would error out. In fact I found that I would get the same error repeatedly if I also tried to uninstall the package via the Ubuntu Software Center as well. But once I did uninstall it I searched for the MySQL and Apache2 packages in the Ubuntu Software Center and installed those and then tried to reinstall OTSR. After getting the very same errors I got initially, and indeed after a short period of time of setting minor configurations in Apache and MySQL, I started researching in Google. After a while of searching and finding nothing specific, and seeing nothing that really told me anything in my log files I decided to approach the installation from another angle.
I wanted to start over again fresh, so I rolled back the changes I had made to Apache2 and MySQL and uninstalled OTSR and Postfix. Copying OTSR from the source tarball to /opt/otsr/
tar xf otrs-2.4.7.tar.gz
mv otrs-2.4.7 /opt/otrs/
I was ready to begin, yet I only knew the basic dependencies like Apache2, a database, and Postfix, but didn’t any other specific dependencies. Luckily Google came through and I was able to find a list of specific Perl modules and some other very helpful instructions that saved me quite a bit of time this afternoon.
aptitude install libapache2-mod-perl2 libdbd-mysql-perl libnet-dns-perl
libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl
libgd-text-perl libgd-graph-perl libapache-dbi-perl mysql-server
With those installed I verified that the otsr user account had been created (it had), but otsr hadn’t been added to the www-data group. The rest of the instructions were easy but Apache2 wouldn’t start because there was a ScriptAlias error. /etc/apache2/conf.d/otrs2 has two alias entries:
ScriptAlias /otrs/ “/usr/share/otrs/bin/cgi-bin/”
Alias /otrs-web/ “/usr/share/otrs/var/httpd/htdocs/”
wouldn’t have worked in any regard because I installed OTRS in /opt/otrs/, however these two lines were conflicting with /etc/apache2/sites-available/default. I commented out the ScriptAlias and Alias lines in /etc/apache2/conf.d/otrs2 and added the following to /etc/apache2/sites-available/default:
Alias /otrs/ “/opt/otrs/bin/cgi-bin/”
< Directory "/opt/otrs/bin/cgi-bin/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
< /Directory>
Alias /otrs-web/ “/opt/otrs/var/httpd/htdocs/”
< Directory "/opt/otrs/var/httpd/htdocs/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128< /Directory>
I also had to add the following code to /usr/share/otrs/scripts/apache2-perl-startup.pl because of the Perl issue discussed here:
BEGIN {
$ModPerl::Util::DEFAULT_UNLOAD_METHOD = ‘unload_package_xs’;
}
use ModPerl::Util;
Once added Apache starts up with no further issues. But what about MySQL? Since I installed MySQL individually it also needed to be configured before I would be ready to look at OTSR. First thing I know I needed to do was create a user account inside MySQL and give that account the permissions it needed. First I set the root password:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h `hostname` password ‘new-password’
Then I created my user and set it’s access:
CREATE USER otsr;
mysqladmin -u root -p ‘grant all on otrs.* to otrs@localhost’
Then I was ready to run the installer: http://localhost/otrs/installer.pl and I encountered no more errors. Which was a good thing because I’d already spent several hours pouring through Google on the various errors and issues I’d encountered up to this point. I wrote most of this largely from memory because I didn’t bother to take notes this afternoon, but my browser’s history file and my log files have captured most of it I think. There may have been a minor issue or two I neglected but I think I captured the major issues and I hope the discussion of them will help someone else avoid what I went through today.
As for Canonical I do recommend that they check into the dependency issue with the OTSR package in the Ubuntu Software Center. This probably isn’t the type of package a beginning user would install but you never know what someone is installing Ubuntu for these days.