This guide will help create a new RT (Request Tracker) server using MySQL, Apache, and mod_perl with a location of http://ip_address/rt. RT also supports other database types, web servers (even as a daemon on it's own), Perl engines, and configurations that are not explained here (please consult the appropriate RT documentation).
Install the packages
Add this line to your LoadModule section in /etc/httpd/conf/httpd.conf:
LoadModule perl_module modules/mod_perl.so
Then, add this to the bottom of httpd.conf:
AddDefaultCharset UTF-8 DocumentRoot "/opt/rt4/share/html" <Location /rt> Order allow,deny Allow from all SetHandler modperl PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /opt/rt4/sbin/rt-server </Location> <Perl> use Plack::Handler::Apache2; Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server"); </Perl>
Create a MySQL database
A MySQL server needs to be installed and running. Create a database for RT by running the following as root (as it writes to /opt/rt4/etc/schema.mysql):
# /opt/rt4/sbin/rt-setup-database --action init
Edit /opt/rt4/etc/RT_SiteConfig.pm (not RT_Config.pm) to make system-level changes to RT. RT_Config.pm is the "default" config file that can be used as a reference for what variables are legal in RT_SiteConfig.pm. It follows a perl syntax like so:
At the very least, make two important changes. WebPath depicts where on the DocumentRoot RT is served (in our case, http://ip_address/rt) and is necessary for the CSS and images to load properly. DatabasePassword is the MySQL database password RT will use when connecting with the internal user (defaults to rt_user). Append this to RT_SiteConfig.pm:
Set($WebPath, '/rt'); Set($DatabasePassword, 'your_password');
USE mysql; UPDATE user SET password=PASSWORD('your_password') WHERE user='rt_user'; FLUSH PRIVILEGES;
Test it out
After completing the sections above, (re)start httpd and try connecting to http://ip_address/rt! Depending on your setup, RT may suggest altering your RT_SiteConfig.pm file to better suit your configuration by writing lines to /var/log/httpd/error_log. An ideal configuration will write no errors to error_log when loading a page.
If you encounter problems, try adding "httpd: ALL" to /etc/hosts.allow, review httpd.conf, and read /var/log/httpd/error_log for errors. Most problems come from permission issues, whether that be with the firewall, the httpd.conf configuration, or the local filesystem.