Request Tracker

= Installing RT in Gentoo =

Intro
Latest version available through Portage:  

Tested on a new basic hardened install on amd64 March 12, 2012.

This guide uses virtual hosting. Virtual hosting means that you can give the appearance of running several servers while using only one machine. If your machine is going to be used only for RT, then you may use this guide as is; the fact that you are using virtual hosting will not be a conflict. However, if your machine is going to be used for other things in addition to RT, and you are not familiar with virtual hosting, you should probably check out Apache's documentation on Virtual Hosts.

Note: This version of the guide assumes that you have updated your Apache installation per this document. This is not needed on a brand new install of apache.

Installation
Turn on the  flag for. If the  flag is disabled,   will be run automatically.

You also need either MySQL or PostgreSQL, so add that to the package use if not already a global use flag. or
 * 1) echo "www-apps/rt vhosts" &gt;&gt; /etc/portage/package.use
 * 1) echo "www-apps/rt mysql" >> /etc/portage/package.use

The above can be combined into one line.
 * 1) echo "www-apps/rt postgres" >> /etc/portage/package.use

To install, enter

It will give a huge list of needed keyword, mask, and USE changes necessary. Verify the USE flags you want are set. Press enter to accept and then # Then run the emerge command again. This will pull in MySQL or PostgreSQL and Apache if not already installed.
 * 1) emerge -av --autounmask-write=y --backtrack=30 rt

Don't forget to run  or

Since we are installing RT into a virtual host, we will need to symlink/copy our installation into our  folder. This guide will use myrt as the hostname.


 * 1) webapp-config -I -h myrt -d rt rt 4.0.5

Database Setup
RT provides a script called  which creates the initial database for you. Please note that  does not create a database user for you. If you have not already created a database user for RT, please consult the appropriate documentation, such as ConfigureMysqlOnGentoo.

MySQL:
If you did not previously have mysql installed, you will need to ConfigureMysqlOnGentoo.

PostgreSQL (untested in current update of this document):

 * 1) /var/www/myrt/rt-4.0.5/sbin/rt-setup-database --action init --dba postgres --prompt-for-dba-password

For this to work, PostgreSQL may need to listen on TCP 5432. In your, set

listen_addresses = 'localhost', port = 5432

Configure RT
After installing RT into the virtual host, you will need to configure RT. RT uses an overlay system for configuration. On Gentoo, the default configuration will be at, and the site-specific configuration will be at. I would recommend copying  over to , and modifying all of the settings in.


 * 1) cd /var/www/myrt/rt-4.0.5/etc
 * 2) cp RT_Config.pm RT_SiteConfig.pm
 * 3) $EDITOR RT_SiteConfig.pm

You should set WebSessionClass to Apache::Session::File if you plan to use internal authentication.

Now you need to set up your database connection, web location, email gateway, etc. Please consult section 7. Configuration of ManualInstallation.

Apache2
Note: Additional information may be found in ManualApacheConfig.

mod_perl
As of rt-3.4.4, mod_perl2 is supported.

Save the following to "/etc/apache2/vhosts.d/rt_apache2.conf", replacing MY_RT_DOMAIN and MY_EMAIL_ADDRESS.

 ServerAdmin MY_EMAIL_ADDRESS # the following line might need to be uncommented: #LoadModule perl_module modules/mod_perl.so    ### Optional apache logs for RT     #ErrorLog /var/www/myrt/rt-4.0.5/var/log/apache2.error #TransferLog /var/www/myrt/rt-4.0.5/var/log/apache2.access #LogLevel debug AddDefaultCharset UTF-8 DocumentRoot "/var/www/myrt/htdocs/rt"  Order allow,deny Allow from all SetHandler modperl PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /var/www/myrt/rt-4.0.5/sbin/rt-server   use Plack::Handler::Apache2; Plack::Handler::Apache2->preload("/var/www/myrt/rt-4.0.5/sbin/rt-server");  

Edit  to instruct   to start with   enabled.

APACHE2_OPTS="[other options] -D PERL"

NOTE: you may need to

chown -R apache:apache /var/www/myrt/rt-4.0.5/var

mod_fastcgi (outdated instructions)
NOTE: If you wish to use, you need to instruct   to install   with appropriate permissions. Edit :

VHOST_DEFAULT_UID="rt" VHOST_DEFAULT_GID="rt"

RT comes with a Gentoo-specific Apache2 configuration file. It can be found in

Copy it to the Apache vhosts directory and edit to set  and [=ServerAdmin]:

cp /var/www/myrt/rt-3.6.1/etc/rt_apache2_fcgi.conf /etc/apache2/vhosts.d/ vim /etc/apache2/vhosts.d/rt_apache2_fcgi.conf

Edit  to instruct   to start with   and enabled.

APACHE2_OPTS="-D FASTCGI"

If this is your first time installing apache, you will want it to start on bootup.

rc-update add apache2 default

Restart apache so that all changes made so far will take effect.

/etc/init.d/apache2 restart

lighttpd (untested)
You can run RT on  +. The ebuild will install an initscript  and a config file.

NOTE: If you wish to use, you need to instruct   to install   with appropriate permissions. Edit :

VHOST_DEFAULT_UID="rt" VHOST_DEFAULT_GID="rt"

You will need to edit  to set RTPATH to the root of your installation. You shouldn't need to edit anything else in that file.

Also note that, under the default configuration, the socket in  is owned by rt:lighttpd, and is chmod-ded to g+rwx. This means that user  needs to be in the   group. One way to do that is to use. If you don't like that, edit  to suit your needs.

You will also need to edit  to enable.


 * Uncomment  under
 * set
 * set  to something like this:

fastcgi.server = ( "/rt" =&gt; ( "rt" =&gt; ( "socket" =&gt; "/var/www/localhost/rt-3.6.1/var/appSocket", "check-local" =&gt; "disable" ) ) )

Be sure to set the correct path to socket (same as  in  ).

Now, start  and  :

/etc/init.d/rt start /etc/init.d/lighttpd start

If things don't seem to be working, check the  logs in   and edit   as per the comments in the file to make the   daemon more verbose.

Note: you should be able to use this initscript with any -enabled webserver. Please send me an email if you get  to work with any other webserver.

Log in
Use your browser to log into RT. Username is, and password is. Change your password.

= Comments, questions, problems = Upgrades (old but likley still relevant)

3.6.1 is out in portage! Can anyone provide some advice on how to upgrade from 3.6.0 to 3.6.1 in gentoo?

Normally this should just be as easy as webapp-config -U -h rt.domain.foo rt 3.6.1. However, the problem here is that none of the ebuilds follow a common structure. eg, some of them install the RT html data into the htdocs, some install into the default hostroot/rt/share/html. It also looks like somewhere along the line someone's changed the default install prefix from hostroot/rt to hostroot/rt-version, so 3.6.1 will install to hostroot/rt-3.6.1 -- TomLanyon