Difference between revisions of "Request Tracker"

From ArchWiki
Jump to: navigation, search
Line 1: Line 1:
 
= Installation =
 
= Installation =
  
The Request Tracker package in the [https://aur.archlinux.org/packages.php?ID=53167 AUR] has been built with [[Apache]], [[MySQL]], and mod_perl in mind.  This section will help create a new RT server based on these specs.  RT also supports other database types, web servers, and Perl engines that are not explained here (please consult the RT documentation).
+
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 [https://github.com/bestpractical/rt/blob/stable/docs/web_deployment.pod appropriate RT documentation]).
  
== Install RT Package ==
+
== Install the packages ==
  
Build and install the RT package from the AUR [https://aur.archlinux.org/packages.php?ID=53167 here].  There are 70 packages from the [[AUR]] that need to be built for RT alongside the official packages.  If your server is x86_64, get a convenient XZ file that contains all of them in a [[Pacman]]-installable format [http://dl.dropbox.com/u/24716740/rt-with-deps.tar.xz here].
+
Build and install the RT package from the AUR [https://aur.archlinux.org/packages.php?ID=53167 here].  Unfortunately, with the entire dependency tree considered, there are 70 total packages that need to be built from the [[AUR]] (alongside the other dependencies found in the official mirrors).  If the server is running Arch x86_64, get a convenient XZ file that contains all of them in a [[Pacman]]-installable format [http://dl.dropbox.com/u/24716740/rt-with-deps.tar.xz here] (extract it to a temporary directory and run pacman -U rt-with-deps/*; ''no guarantee that this is up-to-date'').
  
== Configuring Apache ==
+
You will also want to install [[Apache]] (also referred to as httpd) if it isn't on your server already.
 +
 
 +
== Configure Apache ==
  
 
Add this line to your LoadModule section in /etc/httpd/conf/httpd.conf:
 
Add this line to your LoadModule section in /etc/httpd/conf/httpd.conf:
Line 13: Line 15:
 
  LoadModule perl_module modules/mod_perl.so
 
  LoadModule perl_module modules/mod_perl.so
  
Then, add this to the bottom of httpd.conf also:
+
Then, add this to the bottom of httpd.conf:
  
 
  AddDefaultCharset UTF-8
 
  AddDefaultCharset UTF-8
Line 32: Line 34:
 
  </Perl>
 
  </Perl>
  
Of course, you will want to restart httpd after you make these changes.
+
== 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
 +
 
 +
== Configure RT ==
 +
 
 +
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:
 +
 
 +
Set($''variable'', ''''''setting'''''');
 +
 
 +
'''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:
  
== Creating a MySQL database ==
+
Set($WebPath, '/rt');
 +
Set($DatabasePassword, ''''''your_password'''''');
  
A [[MySQL]] server needs to be installed and running.  Create a database for RT by running the following:
+
After setting a database password, connect to the database ([http://dev.mysql.com/tech-resources/articles/mysql_intro.html#SECTION0003000000 like so]) and update the [[MySQL]] user accordingly:
  
  $ /opt/rt4/sbin/rt-setup-database --action init --prompt-for-dba-password
+
  USE mysql;
 +
UPDATE user SET password=PASSWORD(''''''your_password'''''') WHERE user='rt_user';
 +
FLUSH PRIVILEGES;
  
= Configuring =
+
'''Good admin's tip:''' Since the internal user will barely, if ever, be used to manually log in to your [[MySQL]] server, make the password nice and strong.  There is a program in the mirrors called ''pwgen'' for this.  A good, random, 50-character password should work just fine for keeping the crackers out ;)
  
Edit /opt/rt4/etc/RT_SiteConfig.pm when making '''any''' changes to Request Tracker.  RT_Config.pm is a static configuration file that is bound to change.  However, it does contain all the legal settings in the file, so you may want to glance over it to get an idea of what's available and how the syntax is structured.
+
== Test it out ==
  
'''At the very least, you will want to change your database password by adding a line similar to this in RT_SiteConfig.pm:'''
+
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.
  
  Set($DatabasePassword, 'your_password');
+
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.

Revision as of 06:01, 15 October 2011

Installation

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

Build and install the RT package from the AUR here. Unfortunately, with the entire dependency tree considered, there are 70 total packages that need to be built from the AUR (alongside the other dependencies found in the official mirrors). If the server is running Arch x86_64, get a convenient XZ file that contains all of them in a Pacman-installable format here (extract it to a temporary directory and run pacman -U rt-with-deps/*; no guarantee that this is up-to-date).

You will also want to install Apache (also referred to as httpd) if it isn't on your server already.

Configure Apache

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

Configure RT

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:

Set($variable, 'setting');

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');

After setting a database password, connect to the database (like so) and update the MySQL user accordingly:

USE mysql;
UPDATE user SET password=PASSWORD('your_password') WHERE user='rt_user';
FLUSH PRIVILEGES;

Good admin's tip: Since the internal user will barely, if ever, be used to manually log in to your MySQL server, make the password nice and strong. There is a program in the mirrors called pwgen for this. A good, random, 50-character password should work just fine for keeping the crackers out ;)

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.