Installation on debian lenny

From Asenjo
Jump to: navigation, search

This document describes the installation of Request Tracker (RT) on a GNU/Debian Linux system with mysql and apache2

This is a KVM virtual machine with a amd64 version of Debian Linux.

I will start from a standard installation of Debian Linux without a GUI. The installation of Debian Linux will not be covered here. There is a much better documentation about that at http://www.debian.org/releases/stable/installmanual.

I will describe with detail how you install RT with debian linux. I will not explain how to configure the mail gateway or how to use scripts. For that information, please refer to the wiki:

First we need to download the latest stable release of RT:

$ wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz [enter]

(I use wget from the linux server self to download the software; you may choose to download it from your workstation with windows and transfer it to the server with winscp.exe, for instance).

The tarball is saved in the home directory of the user who has downloaded the file as $HOME/rt.tar.gz; the rest of the installation will be done as root:

Become root, unpack software

$ su - [enter]
[enter root password]

I copy the tarball to the home directory of root, you can copy it anywhere you like:

# cp /home/user/rt.tar.gz /root/

I uncompress the tarball

# tar xzvf rt.tar.gz 

A new directory is created:

# ls -l
drwxr-xr-x 11  501 staff 4.0K Jun 10 20:54 rt-3.8.4
-rw-r--r--  1 root root  3.2M Jun 10 23:00 rt.tar.gz

Requirements

As you see, the most recent stable version of RT is 3.8.4. We enter this directory and in there there is a README file. Please read it, as it contains important information.

We read there that RT requires at least this:

  • Perl 5.8.3 or later;
  • a supported SQL database (mysql, postgresql, oracle and sqlite, check the readme for the versions);
  • the apache webserver with mod_perl or fastcgi support; in theory you can use any webserver with fastcgi support, but most people use apache, so you

will probably get more help with that if you run into trouble.

  • varios perl modules: this is the biggest hurdle that we will have to surpass.

Install software with debian package management

So let's start. First, we will install apache2, the mysql database server, the build-essential package with the essential compiling tools and a bunch of perl modules already bundled in debian:

# apt-get install apache2 mysql-server build-essential unzip libwant-perl \
libclass-returnvalue-perl libhtml-scrubber-perl libtext-quoted-perl \
libcalendar-simple-perl libfile-sharedir-perl libregexp-common-perl \
libmodule-versions-report-perl libcache-simple-timedexpiry-perl \
libwww-perl libdata-ical-perl libhttp-server-simple-perl \
libnet-server-perl libgnupg-interface-perl liblocale-maketext-lexicon-perl \
liblocale-maketext-fuzzy-perl libtext-wrapper-perl liblog-dispatch-perl \
libuniversal-require-perl libemail-address-perl libtree-simple-perl \
libtext-template-perl libhtml-mason-perl libapache-session-perl \
libtext-wikiformat-perl libxml-rss-perl libcgi-fast-perl \
libtime-modules-perl libmime-tools-perl libdbix-searchbuilder-perl \
libcss-squish-perl libperlio-eol-perl libmime-types-perl libgd-text-perl \
libgd-graph-perl

Answer 'y' and watch the software install itself. You will be prompted for a password for root for the mysql server, remember it, you will need it later. There will be a lot of output on screen while the software gets installed, this is normal. When it is finished, you will be back at the root prompt.

Installation of Request Tracker

Then we can star installing RT. At the rt-3.8.4 directory run this:

# ./configure
ecking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... no
checking for mawk... mawk
checking for perl... /usr/bin/perl
checking for chosen layout... relative
checking if user www exists... not found
checking if user www-data exists... found
checking if group www exists... not found
checking if group www-data exists... found
checking if group rt3 exists... not found
checking if group rt exists... not found
checking if group www-data exists... found
checking if database name is valid... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for aginitlib in -lgraph... no
checking for gdlib-config... no
checking for gpg... yes
configure: creating ./config.status
config.status: creating etc/upgrade/3.8-branded-queues-extension
config.status: creating etc/upgrade/3.8-ical-extension
config.status: creating sbin/rt-attributes-viewer
config.status: creating sbin/rt-dump-database
config.status: creating sbin/rt-setup-database
config.status: creating sbin/rt-test-dependencies
config.status: creating sbin/rt-email-digest
config.status: creating sbin/rt-email-dashboards
config.status: creating sbin/rt-clean-sessions
config.status: creating sbin/rt-shredder
config.status: creating sbin/rt-validator
config.status: creating sbin/rt-email-group-admin
config.status: creating sbin/rt-server
config.status: creating bin/mason_handler.fcgi
config.status: creating bin/mason_handler.scgi
config.status: creating bin/standalone_httpd
config.status: creating bin/rt-crontool
config.status: creating bin/rt-mailgate
config.status: creating bin/rt
config.status: creating Makefile
config.status: creating etc/RT_Config.pm
config.status: creating lib/RT.pm
config.status: creating bin/mason_handler.svc
config.status: creating bin/webmux.pl

If there are no errors, you will be back at the prompt. The configure script has checked that necessary users, groups and programs exist. If they had not been found, it would have failed quite clearly.

For example, it we didn't have installed the build-essential package, configure would not have found the c compiler:

....
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
.....

ok, now let's get to the next step. RT ships with one dependency check, so let's use it:

# make testdeps

Thanks to the initial software installation with apt-get, there are very few dependencies left. We will resolve those through CPAN, the Comprehensive Perl Archive Network. Follow the instructions of the README file:

# make fixdeps

We get this error:

You haven't configured the CPAN shell yet.
Please run `/usr/bin/perl -MCPAN -e shell` to configure it.
make: *** [fixdeps] Error 1

Run then:

# /usr/bin/perl -MCPAN -e shell

answer yes to all the prompts. When you see this prompt:

cpan[1]>

type 'quit' and rerun make fixdeps. Answer yes to all the prompts :-)

The CPAN module will download and compile all the necessary modules.

When it is done you will be back at a linux root prompt. Run make testdeps and you should see this:

..... (lots of output)
All dependencies have been found.

We're nearly done. Now run:

# make install

At the end you should see this:

.....lots of output......
Congratulations. RT is now installed.


You must now configure RT by editing /opt/rt3/etc/RT_SiteConfig.pm.

(You will definitely need to set RT's database password in 
/opt/rt3/etc/RT_SiteConfig.pm before continuing. Not doing so could be 
very dangerous.  Note that you do not have to manually add a 
database user or set up a database for RT.  These actions will be 
taken care of in the next step.)

After that, you need to initialize RT's database by running
 'make initialize-database'

So we are going to do this, but first we well configure a minimal RT. We do that editing /opt/rt3/etc/RT_SiteConfig.pm. We can check the possible values in /opt/rt3/etc/RT_Config.pm

a minimal RT_SiteConfig to get started is this:

Set( $rtname, 'yourorg.tld');
#Set(@Plugins,(qw(Extension::QuickDelete RT::FM)));

Set($Organization , "yourorg.tld");
Set($Timezone , 'Europe/Amsterdam');
Set($DatabaseType , 'mysql');
Set($DatabaseHost   , 'localhost');
Set($DatabasePort , '');
Set($DatabaseUser , 'rtuser');
Set($DatabasePassword , 'yourpass');
Set($DatabaseName , 'rt3');

1;

the file is a Perl module, so it *must* end in "1;". "#" indicate that whatever comes after it is a comment.

so we run:

# make initialize-database
/usr/bin/perl sbin/rt-setup-database --action init --dba root
--prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to
your  mysql instance on localhost as root
Please specify that user's database password below. If the user has no
database
password, just press return.

Password:
Working with:
Type:   mysql
Host:   localhost
Name:   rt3
User:   rtuser
DBA:    root
Now creating a mysql database rt3 for RT.
Done.
Now populating database schema.
Done.
Now inserting database ACLs
Granting access to rtuser@'localhost' on rt3.
Done.
Now inserting RT core system objects
Done.
Now inserting data
Done inserting data
Done.

You are prompted for the root mysql password you entered at the beginning of the tutorial.

After this we need to setup the web interface. In the README file there are some examples for mod_perl 1 and fastcgi. I have no experience with those. I have installed it with mod_perl 2. This module has already been installed as a dependency. If it hasn't, install it like this:

# apt-get install libapache2-mod-perl2

the intallation will enable it. In case it does not, run this:

# a2enmod perl

and restart apache2:

# apache2ctl restart

After that we can configure apache2 for RT. In my case, I am going to run it as the default website. So I edit /etc/apache2/sites-available/default like this:

<VirtualHost *:80>
ServerName server.domain.tld

    DocumentRoot /opt/rt3/share/html
    AddDefaultCharset UTF-8

    # optional apache logs for RT
    # ErrorLog /opt/rt3/var/log/apache2.error
    # TransferLog /opt/rt3/var/log/apache2.access

    PerlRequire "/opt/rt3/bin/webmux.pl"

    <Location /NoAuth/images>
        SetHandler default
    </Location>
    <Location />
        SetHandler perl-script
        PerlResponseHandler RT::Mason
    </Location>

</VirtualHost>

If you already have apache2 on your server and want to configure an extra virtual host, consult the (excellent) apache documentation.

I have only changed the ServerName Directive from the example given in the README file provided by the rt sources.

After that, just reload apache2 and login your brandnew Request Tracker. Point your browser to http://server.domain.tl and login as root with password 'password'.

I am not going to explain how to setup the mail interface. This is a manual for installing Asset Tracker. In order to install Asset Tracker I need RT first, that's why I explained its installation in detail.

Installation Asset Tracker

download at from http://code.google.com/p/asset-tracker-4rt/downloads/list

$ wget http://asset-tracker-4rt.googlecode.com/files/at-1.2.3.tar.gz
$ tar xzvf at-1.2.3.tar.gz
$ ./configure --with-rt-home=/opt/rt3/ \
--with-rt-local=/opt/rt3/local/ --with-rt-localhtml=/opt/rt3/local/html/ \
--with-db-admin=root --with-rt-group=www-data

$ su -
# cd /path/to/at-dir
# make install

You need to enter your root mysql password. With the last version of at there is an installation error, sounds worse than wat it is:

Creating types...[Tue Jul 21 19:51:34 2009] [crit]: Can't locate object method
"ACLEquivalenceObjects" via package "RTx::AssetTracker::System" at
/opt/rt3/lib/RT/Principal_Overlay.pm line 327, <SCHEMA> line 78.
(/opt/rt3/lib/RT.pm:377)
Can't locate object method "ACLEquivalenceObjects" via package
"RTx::AssetTracker::System" at /opt/rt3/lib/RT/Principal_Overlay.pm line 327,
<SCHEMA> line 78.
make: *** [initdb] Error 255

What we need is to edit this file: /opt/rt3/local/lib/RTx/AssetTracker/System.pm

replace /opt/rt3/local/ with your path for rt-local during the configure step.

Add at the end of the file, but right before the last line that only has '1' in it, this line:

sub ACLEquivalenceObjects { return () };

Congratulations! Login your new RT+ AT instance! Point your browser to http://servername, where servername is the one you specified in the VirtualHost section from the apache webserver. The only user now is 'root' and its password is 'password'. Please change it now!