RT 4.2.6 on Ubuntu 12.04 LTS with MySQL and Sendmail

From Request Tracker Wiki
Revision as of 18:55, 13 August 2014 by 146.113.31.100 (talk) (Adding categories)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

This is the process I used to set up RT 4.2.6 on Ubuntu 12.04 LTS to use MySQL, Apache, Sendmail, and the ExternalAuth plugin.

Install and patch Ubuntu to your satisfaction

Install several packages that will be required for installation

sudo apt-get install mysql-common mysql-server sendmail gcc apache2 cpanminus libssl-dev libgd2-xpm-dev libapache2-mod-perl2 libnet-ldap-perl graphviz

When prompted, enter password for MySQL root user. Keep this password handy for later.

Download RT

wget download.bestpractical.com/pub/rt/release/rt-4.2.6.tar.gz

Expand archive

tar xzvf rt-4.2.6.tar.gz

Run cpan (and accept default configuration options)

sudo cpan

Reboot

Use CPAN to install modules FCGI and FCGI::ProcManager

sudo cpan FCGI
sudo cpan FCGI::ProcManager

Test dependencies (we expect to find many missing)

sudo make testdeps

Fix missing dependencies

sudo make fixdeps

Double-check dependencies by running make testdeps again.

sudo make testdeps

Run configure

sudo ./configure

Make install

sudo make install

Perform initial edit of RT_SiteConfig.pm. Add the few vital lines we need

Set( $rtname, 'yourservername.site.you');
Set($Organization, "site.you");
Set($WebDomain, "yourservername.site.you");
Set($WebPort, 443);
Set($DatabasePassword, q{yourdesiredpassword});

Set up database (this is where you need the MySQL root password you set earlier)

sudo make initialize-database

Create main Apache site for SSL at /etc/apache2/sites-available/my-rt-site


    ErrorLog /opt/rt4/var/log/apache2.error
    TransferLog /opt/rt4/var/log/apache2.access
   # LogLevel debug
   AddDefaultCharset UTF-8
   DocumentRoot "/opt/rt4/share/html"
   
       Order allow,deny
       Allow from all
       SetHandler modperl
       PerlResponseHandler Plack::Handler::Apache2
       PerlSetVar psgi_app /opt/rt4/sbin/rt-server
   
   
       use Plack::Handler::Apache2;
       Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server");
   
    SSLEngine On
    SSLCertificateFile /path/to/cert.pem
    SSLCertificateKeyFile /path/to/key.pem
    SSLCertificateChainFile /path/to/chainfile.crt

Create Apache site for SSL redirect at /etc/apache2/sites-available/my-rt-ssl-redirect


       Redirect permanent / https://yourservername.site.you/

Edit /etc/apache2/httpd.conf to specify the servername

ServerName yourservername.site.you

Enable SSL in Apache

sudo a2enmod ssl

Enable your new Apache sites. In /etc/apache2/sites-enabled/

sudo ln -s /etc/apache2/sites-available/my-rt-site
sudo ln -s /etc/apache2/sites-available/my-rt-ssl-redirect

Remove the default Apache site

sudo unlink 000-default

Put your applicable SSL certificate files in place in the locations specified above (your /path/to/cert.pem, /path/to/key.pem, and /path/to/chainfile.crt, as appropriate).

Reboot

Visit your site with a web browser over HTTPS.

Sign in with initial credentials (root:password) to verify that you've been successful so far.

Make sure your users can reply to tickets (perhaps globally with the "Requestor" role in Group Rights).

Create a "Testing" RT queue that you wish to mail-enable. Assuming your Reply and Comment addresses are test-tickets@yourservername.site.you and test-tickets-comment@yourservername.site.you, edit /etc/aliases to specify the Reply and Comment addresses for your queue.

test-tickets:                        "|/opt/rt4/bin/rt-mailgate --queue 'Testing' --action correspond --url 'https://yourservername.site.you'"
test-tickets-comment:                "|/opt/rt4/bin/rt-mailgate --queue 'Testing' --action comment --url 'https://yourservername.site.you'"

Create a user to use for testing. Make it an AdminCC of your test queue.

Configure incoming mail. Consult with someone who knows sendmail well. Edit sendmail configs as appropriate. If you're only creating a test system, edit /etc/mail/sendmail.mc and edit this line

DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl

to look like this:

DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl

Run make:

make -C /etc/mail

Restart sendmail:

sudo /etc/init.d/sendmail reload

Try a few test transactions via email to verify success so far.

Download RT-Authen-ExternalAuth

wget http://search.cpan.org/CPAN/authors/id/T/TS/TSIBLEY/RT-Authen-ExternalAuth-0.17.tar.gz

Expand RT-Authen-ExternalAuth

tar xzvf RT-Authen-ExternalAuth-0.17.tar.gz

Install RT-Authen-ExternalAuth

sudo perl Makefile.PL
sudo make
sudo make install

Further configure RT_SiteConfig.pm as appropriate for your environment to enable the RT-Authen-ExternalAuth plugin (how to do so is beyond the scope of this document).

You should now be able to add new users from your organization and have them populate with the data you specified in your config.