GentooInstallGuide

From Request Tracker Wiki
Revision as of 19:08, 10 March 2012 by Ashleywillis (talk) (removed outdated sections below "Comments, questions, problems")
Jump to navigation Jump to search


Unofficial Installation Guide

This is an unofficial installation guide. It may be outdated or apply only to very specific configurations and versions. The official and maintained installation steps for RT are in the README and UPGRADING documents included in the official .tar.gz packages.

Outdated

This page contains out of date and possibly misleading information or instructions such as installation methods or configuration examples that no longer apply. Please consider this warning when reading the page below.


Installing RT in Gentoo

Intro

Latest version available through Portage: rt-4.0.5

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.

Turn on the vhosts flag for rt. If the vhosts flag is disabled, webapp-config will be run automatically.

  1. echo "www-apps/rt vhosts" >> /etc/portage/package.use

RT is masked in Gentoo. For amd64, unmask it with

  1. echo "www-apps/rt ~amd64" >> /etc/portage/package.accept_keywords

Replace ~amd64 with ~x86 for 32 bit x86 systems.

It's also probably a good idea to unmask the following, or it will want to pull in masked perl (replace ~amd64 with ~x86 as above):

  1. echo "=virtual/perl-locale-maketext-1.220.0 ~amd64" >> /etc/portage/package.accept_keywords

Installation

To install, simply type

  1. emerge rt

It will likely complain that "The following keyword changes are necessary to proceed:", followed by lines such as

#required by >=dev-perl/HTML-Mason-1.43 (argument)
=dev-perl/HTML-Mason-1.480.0 ~amd64

Copy and paste those pairs of lines with

  1. $EDITOR /etc/portage/package.accept_keywords

Don't forget to run etc-update or dispatch-conf

Note: you might need to keyword a few dependencies, or change their USE flags; recent Portage versions will take care of that through the use of emerge --autounmask-write=y.

Since we are installing RT into a virtual host, we will need to symlink/copy our installation into our /var 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 rt-setup-database which creates the initial database for you. Please note that rt-setup-database 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.

  • For MySQL:

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

Verify that the skip-innodb is commented out in /etc/mysql/my.cnf. If it is not, then put an octothorpe in front of it:

  1. skip-innodb

and restart the mysql server:

  1. /etc/init.d/mysql restart

Then set up the database:

  1. /var/www/myrt/rt-4.0.5/sbin/rt-setup-database --action init --dba root --prompt-for-dba-password
  • For PostgreSQL (untested in current update of this document):

    /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 postgresql.conf, 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 /var/www/myrt/rt-4.0.5/etc/RT_Config.pm, and the site-specific configuration will be at /var/www/myrt/rt-4.0.5/etc/RT_SiteConfig.pm. I would recommend copying RT_Config.pm over to RT_SiteConfig.pm (which does not get installed), and modifying all of the settings in RT_SiteConfig.pm.

  1. cd /var/www/myrt/rt-4.0.5/etc
# cp RT_Config.pm RT_SiteConfig.pm
# $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.

Configure Webserver

Apache2

mod_perl (outdated)

As of rt-3.4.4, mod_perl2 is supported.

RT comes with a Gentoo-specific Apache2 configuration file. It can be found in /var/www/myrt/rt-3.6.1/etc/rt_apache2.conf

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

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

vim /etc/apache2/vhosts.d/rt_apache2.conf

NOTE: -As of 12/09/2005 there is a gotcha in /var/www/myrt/rt-3.6.1/etc/rt_apache2.conf. When using mod_perl2 then you need to change: PerlModule Apache::DBI to PerlModule Apache2::DBI- This should not be necessary with a properly configured mod_perl2.

NOTE: Also consider specifying the actual path of your perl modules on the [=PerlSetEnv] line. For details about [=PerlSetEnv] go to =.

<Location />

    ............
    PerlHandler RT::Mason
    PerlSetEnv PERL5LIB /usr/lib/perl5/vendor_perl/5.8.7:/usr/lib/perl5/5.8.7
    ............
</Location>

Edit /etc/conf.d/apache2 to instruct apache to start with PERL and enabled.

APACHE2_OPTS="-D PERL"

NOTE: you may need to

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

mod_fastcgi (outdated)

NOTE: If you wish to use mod_fastcgi, you need to instruct webapp-config to install rt with appropriate permissions. Edit /etc/vhosts/webapp-config:

VHOST_DEFAULT_UID="rt"

VHOST_DEFAULT_GID="rt"

RT comes with a Gentoo-specific Apache2 configuration file. It can be found in /var/www/myrt/rt-3.6.1/etc/rt_apache2_fcgi.conf

Copy it to the Apache vhosts directory and edit to set MY_RT_DOMAIN 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 /etc/conf.d/apache2 to instruct apache2 to start with FASTCGI 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 lighttpd + fastcgi. The ebuild will install an initscript /etc/init.d/rt and a config file /etc/conf.d/rt.

NOTE: If you wish to use mod_fastcgi, you need to instruct webapp-config to install rt with appropriate permissions. Edit /etc/vhosts/webapp-config:

VHOST_DEFAULT_UID="rt"

VHOST_DEFAULT_GID="rt"

You will need to edit /etc/conf.d/rt 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 $FCGI_SOCKET_PATH is owned by rt:lighttpd, and is chmod-ded to g+rwx. This means that user lighttpd needs to be in the rt group. One way to do that is to use vigr. If you don't like that, edit /etc/init.d/rt to suit your needs.

You will also need to edit /etc/lighttpd.conf to enable mod_fastcgi.

  • Uncomment mod_fastcgi under server.modules
  • set server.document-root
  • set fastcgi.server to something like this: fastcgi.server = ( "/rt" => ( "rt" => ( "socket" => "/var/www/localhost/rt-3.6.1/var/appSocket", "check-local" => "disable" ) ) )

Be sure to set the correct path to socket (same as $FCGI_SOCKET_PATH in /etc/conf.d/rt).

Now, start rt and lighttpd:

/etc/init.d/rt start

/etc/init.d/lighttpd start

If things don't seem to be working, check the lighttpd logs in /var/log/lighttpd and edit /etc/init.d/rt as per the comments in the file to make the rt daemon more verbose.

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

Log in

Use your browser to log into RT. Username is root, and password is password. 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