Installing Request Tracker on CentOS 5.5

This is how I installed RT3 on CentOS 5.5. Much of it is taken from the pitov article, but there were various shortcuts that I found, as well as a few things that seem to have changed since that one was written.

RT3 itself isn't the problem, the problem is the myriad of perl dependencies and how some are too old, and others just don't work.

Unfortunately, we will have to go through CPAN if you haven't yet done it. (Note that although it asks for the program links and ncftp, I've gotten away without installing them, just hit enter. However, you do need ftp)

(Our perl expert at work tells me there is now a module for unattended installs here. Note that its author's FAQ has the question, "Are you on drugs?")

To do this, we will want to add both the rpmforge repo and the EPEL repos. The user is also STRONGLY advised to read the CentOS wiki article on setting priorities as both of these repos can overwrite other important rpms, damaging your system. That being said, using priorities, or leaving both repos disabled by default (by changing the enabled=1 in the repo file to enabled=0) and only using them by special command is pretty safe. Generally, I leave rpmforge enabled, giving it a lower priority than the CentOS official repos, and leave EPEL disabled, only enabling it with yum --enablerepo=epel when I need it.

Also, enable the CentOS plus repo in the CentOS-Base.repo, by changing enabled=0 to enabled=1. (Again set priorities.)

First, install some needed packages.
yum -y install httpd httpd-devel apr-devel mysql-server mysql-devel
mysql mod_perl

The EPEL repo does have a version of realtracker. It doesn't create an /opt/rt3 directory, and I actually don't know how well it works, as, for various reasons having to do with compatibility and moving an old install to a new server, we wanted to stay with an older version. However, it will pull in a great many of the perl modules needed, so I install it, then remove it. Remember, I leave this repo disabled by default. Also, if *you* don't leave rpmforge's repo disabled by default, disable it for this, or there will be some perl conflicts. (If you have it disabled by default, no need for the disablerepo option that I use below).
yum --disablerepo=rpmforge --enablerepo=epel install rt3

Once it's installed, I just remove it. It's done what I want it to do, and it should just remove rt3 itself, without taking any of the perl packages it pulled in. If doing yum remove rt3 starts to take perl packages with it (yum shows what it will do before doing it), just use rpm -e --nodeps rt3, but this shouldn't be necessary.

Next download the desired version of rt3 from bestpractical. As mentioned, I used an earlier version, but the latest is 3.8.8.

Once downloaded, untar it and change into the directory this creates. We'll assume you're using 3.8.8.
tar xvf rt-3.8.8.tar.gz
cd rt-3.8.8

Configure it. (Using --with-mysql may be unnecessary, as it's the default, but it didn't seem to hurt anything.)
./configure --with-web-user=apache --with-web-group=apache --with-modperl2
--with-mysql

Add the group rt.
groupadd rt

Change the rt:x:<somenumber>line in /etc/group to add apache as a member. For example, if group rt was created with a GID of 501, so that it shows as
rt:x:501

Change it to read
rt:x:501:apache

Now the fun part. Find out which perl modules are still missing. Still in the rt-3.8.8 directory run (and note that it's sbin, NOT /sbin--you are using the perl program in the rt3 directory (if your browser breaks this, it should all be on one line.)
perl sbin/rt-test-dependencies --with-mysql --with-modperl2 --verbose|grep MISSING

This next part should be done as root, otherwise you'll get some failures.

Install the various missing modules. First, you'll have to go through CPAN. For example, one of the missing ones is probably going to be Test::Expect
perl -MCPAN -e 'install Test::Expect'

Now, you will have the joy of going through CPAN. When it asks for ncftp, or links, you can just hit enter, and as long as you have ftp installed, it should work. Once that's done, the first time, with luck, the modules will install. (You may have to run the specific install, for example, for Test::Expect once more after CPAN is finished.) However, some modules may not install without a force option.

In one of my early tries at this, WWW::Mechanize failed and gave a message that it refused to install without using "force." One can google for various solutions, but after a few hours of that, it seemed the majority of people running into this finally said, The heck with it, and used force, as I did. It doesn't seem to have hurt anything.
perl -MCPAN -e shell
That gives you a cpan prompt. Force the install, just like they say you have to.
cpan> force install WWW:Mechanize

Now in my case Sys::Syslog was too old of a version to work. I'm not sure why this happened, if it was the EPEL version, got pulled in with one of the missing perl modules, or something else. Either way, I got it from rpmforge. However--it would choke on install because there were man page conflicts. So, I just downloaded the rpm and installed it with the --force option. First, you need the yum-downloader plugin, then get the rpm.
yum -y install yum-downloadonly
yum --enablerepo=rpmforge --downloadonly install perl-Sys-Syslog

If you do it this way, it will get it, then say it's exiting because it's download only. The package will be in /var/cache/yum/rpmforge/packages. So,
rpm -ivh --force /var/cache/yum/packages perl-Sys-Syslog-0.27-1.elf.rf.x86_64.rpm 

(or whatever version of it that you got--this was an x86_64 version.)

Now, you can install rt3. Still in the rt3 directory
make install

According to the bestpractical install instructions, mysql isn't able to create the user so you have to do that first. It turns out to not be necessary, but if you want to, you can create the user first. For this example, we'll give both root and the user a password of 1234--it's hoped that the reader chooses a stronger password. Regardless of whether you create the user or not, give root a mysql password, you will need it when we run the make initiate-databse.
service mysqld start
mysqladmin -u root password 1234
mysql -u root -p1234

This will bring you to a mysql prompt
mysql>GRANT ALL PRIVILEGES on rt3.* TO 'rt_user'@'localhost' IDENTIFIED by '1234';

Next initiate the database. Back in the rt-3.8.8 directory
make initialize-database

If something goes wrong (for example, it was here that the Sys::Syslog error came up, drop the database, try to fix the problem and try again.
make dropdb
Then run make initialize-database again.

Edit /etc/httpd/conf/httpd.conf. Let's say I'm doing a VirtualHost and the name of it will be rt.mycompany.com, and that the IP address has been put in my company's DNS.
<VirtualHost rt.mycompany.com>
DocumentRoot "/opt/rt3/share/html"
ServerName rt.mycompany.com

<Location />
        SetHandler perl-script
        PerlHandler RT::Mason
</Location>

PerlModule Apache::DBI
PerlRequire /opt/rt3/bin/webmux.pl
</VirtualHost>

Hopefully, if you now point your web browser to rt.mycompany.com (or whatever IP address you have set for this server), you will be at an rt login page.