Skip to content

Instantly share code, notes, and snippets.

@bheisig
Last active October 4, 2021 12:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save bheisig/a4a34ffa85ebf1c3c5dc8dd8b46a0040 to your computer and use it in GitHub Desktop.
Save bheisig/a4a34ffa85ebf1c3c5dc8dd8b46a0040 to your computer and use it in GitHub Desktop.
Install Request Tracker (RT) 4.4.1 on Debian GNU/Linux 8.6 (Or: How I survived Perl's CPAN dependency hell…)

Aim

Our aim is to install Request Tracker (RT) 4.4.2 on Debian GNU/Linux 8.6 with less pain

Note: This won't work with Debian GNU/Linux 9.x.

Problems

At the time of writing…

  • There is no nice and clean setup guide
  • There is no Debian package for RT's 4.4 branch
  • RT's README and its Makefile "help" are controversial
  • A typical installation often leads to Perl's CPAN dependency hell

Preparation

Install Debian GNU/Linux 8.6 or higher.

Install needed distribution packages:

sudo apt update
sudo apt install build-essential apache2 libapache2-mod-fcgid mariadb-server-10.0 mariadb-client-10.0 libssl-dev libexpat1-dev

Get it done

wget https://download.bestpractical.com/pub/rt/release/rt-4.4.2.tar.gz
tar xzvf rt-4.4.2.tar.gz
cd rt-4.4.2
./configure --with-web-user=www-data --with-web-group=www-data
sudo /usr/bin/perl -MCPAN -e shell # Quit with CTRL+D
sudo make testdeps
sudo make fixdeps # Press ENTER when needed
sudo make install

Test your installation with the built-in Web server: sudo /opt/rt4/sbin/rt-server --port 8080. Hit CTRL-C to stop the process.

Configure Apache Web server

We choose Apache2 Web Server and FastCGId. RT will be available under the URL /rt.

Edit RT's local configuration file /opt/rt4/etc/RT_SiteConfig.d/myissues.pm:

# sudo nano /opt/rt4/etc/RT_SiteConfig.d/myissues.pm
Set($WebPath, "/rt");

Create a new VirtualHost:

# sudo nano /etc/apache2/sites-available/myissues.conf
<VirtualHost *:80>
        ServerName myissues.example.com
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        AddDefaultCharset UTF-8

        ScriptAlias /rt /opt/rt4/sbin/rt-server.fcgi/

        <Location /rt>
                Require all granted
                Options +ExecCGI
                AddHandler fcgid-script fcgi
        </Location>
</VirtualHost>

Replace default VirtualHost with your new one and restart Apache Web server:

sudo a2dissite 000-default
sudo a2ensite myissues
sudo systemctl restart apache2.service

Open http://myissues.example.com/rt/ (or something similar) in a Web browser to test everything runs smoothly.

Re-work

From RT's README:

  • Set up users, groups, queues, scrips and access control
  • Set up automated recurring tasks (cronjobs)
  • Configure the RT email gateway
  • Set up full text search
  • Set up automatic backups

…and keep your operating system clean and updated.

What's next?

Update/upgrade RT! Oh my gosh…

Sources that helped me

@sboothe
Copy link

sboothe commented Dec 18, 2019

Hi Benjamin! Just happy to leave a quick note that so far I have made it through this little recipe with only one minor issue that came up:

  • sudo make fixdeps # Press ENTER when needed
  • "GnuPG::Interface ...MISSING"
  • execute cpan install -f GnuPG::Interface
  • sudo make fixdeps #all good
  • sudo make install

Now I'm just trying to come up to speed with the configuration bits which are also a bit cryptic but I'll get there eventually...

Thanks again for putting this together though!

@sboothe
Copy link

sboothe commented Dec 18, 2019

Hi Benjamin, just another quick note here. Following your instructions above where you advise to test your installation after make install yields the following error:

# /opt/rt4/sbin/rt-server --port 8080
[11908] [Wed Dec 18 23:30:30 2019] [warning]: DBI connect('dbname=rt4;host=localhost','rt_user',...) failed: Access denied for user 'rt_user'@'localhost' at /usr/local/share/perl/5.28.1/DBIx/SearchBuilder/Handle.pm line 106. (/usr/share/perl/5.28/Carp.pm:291)

RT couldn't connect to the database where tickets are stored.
If this is a new installation of RT, you should visit the URL below
to configure RT and initialize your database.

@jerrylindahl
Copy link

Some extra steps needed when I did this on Debian 10:
apt install libgnupg-interface-perl
apt install zlib1g-dev
cpan install LWP::Protocol::https
cpan install IO::Socket::SSL
cpan install Net::SSLeay

@bheisig
Copy link
Author

bheisig commented Jan 21, 2020

Thanks for your feedback! Seems like this gist is pretty out-dated: Debian 8 is currently oldoldstable and shouldn't be used in production. Please handle the information with care ;-)

@Piuliss
Copy link

Piuliss commented Oct 4, 2021

Some extra steps for Debian 10, RT 4.4.*

sudo apt install build-essential libapache2-mod-fcgid libssl-dev libexpat1-dev libdbd-mysql-perl liblwp-protocol-https-perl libhtml-formattext-withlinks-andtables-perl libhtml-formattext-withlinks-perl html2text graphviz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment