Continued from Part 1/2
Previously we covered installing Debian and configuring some basics. This time we dig into installing Request Tracker 4 and making it work.
Install Required Packages
Edit your APT sources file:
sudo nano /etc/apt/sources.list
Add the lines below and save:
# wheezy-backports deb http://ftp.debian.org/debian/ wheezy-backports main
Update your available packages, install Request Tracker 4, Apache 2, PostGreSQL and lynx:
sudo aptitude update sudo aptitude -t wheezy-backports install request-tracker4 \ rt4-apache2 rt4-clients rt4-db-postgresql apache2-doc lynx \ postgresql apache2 libapache-dbi-perl fetchmail
You now need to configure some basic RT settings:
- Name for this RT Instance ($rtname) – example.com (pick something unique to your organization like your domain name)
- Handle RT_SiteConfig.pm Permissions – Yes
- More stuff installs.. (time for more coffee)
- Configure database for request-tracker4 with dbconfig-common – Yes
- Set the PostgreSQL application password for request-tracker4
- Initial root password for RT system
- More stuff installs..
You can choose any MTA you want but I have decided to keep the Debian default of Exim4.
Please note that your email setup may be different and require additional configuration. For example if you use Google Apps you will need to configure authentication and SSL. I have added a couple of links at the end of this page with further information.
To reconfigure Exim:
sudo dpkg-reconfigure exim4-config
Configure Exim4 to work in your environment:
- Select: mail sent by smarthost; received by SMTP or fetchmail
- System mail name: example.com
- IP-addresses to listen on for incoming SMTP connections: leave at default
- Other destinations for which mail is accepted: leave at default
- Machines to relay mail for: leave blank
- IP address or hostname of the outgoing smarthost: smtp.isp.com
- Hide local mail name in outgoing mail?: Yes
- Visible domain name for local users: example.com
- Keep number of DNS-queries minimal (Dial-on-Demand): No
- Delivery method for local mail: mbox format in /var/mail (default)
- Split configuration into small files: No
Test outbound mail by emailing a file to yourself (edit to suit):
mailx -s "Exim4 email Test" firstname.lastname@example.org < /etc/fstab
Check your e-mail to see if this is working. If the email doesn’t come through in a few minutes you might want to check the Exim4 configuration.
Basic RT Configuration
Edit the RT config file
sudo nano /etc/request-tracker4/RT_SiteConfig.pm
Find and edit the following lines from:
Set($CorrespondAddress , 'email@example.com'); Set($CommentAddress , 'firstname.lastname@example.org');
Set($CorrespondAddress , 'email@example.com'); Set($CommentAddress , 'firstname.lastname@example.org');
Also paste the following lines to the end of the file, then save and exit:
Set($MaxAttachmentSize , 10000000); Set($FriendlyFromLineFormat, "\"%s\" <%s>");
Edit the apache2 default available sites:
sudo nano /etc/apache2/sites-available/default
Find the end of the file “</VirtualHost>” and add the following line just above it:
Include /etc/request-tracker4/apache2-modperl2.conf RedirectMatch ^/$ /rt
Save the file and exit.
To enable mod_rewrite run the command:
sudo a2enmod rewrite
And then restart apache2:
sudo service apache2 restart
RT Web Configuration
You should now be able to see the RT Web Login Screen (http://rt.example.com/rt/) and be able to login with the username “root” and the password configured during installation (note. this is the root user for RT not your system).
You can now edit the configuration for the queue. Change the Description as this will appear as the senders name in emails from the queue.
When you are happy with the queue settings click on Group Rights (top right-hand corner):
As below make sure Everyone is selected before ticking the boxes next to:
- Comment on tickets
- Create tickets
- Reply to tickets
and then click Save Changes.
Enable the fetchmail daemon to start:
sudo nano /etc/default/fetchmail
Modify the last line and save:
Create a new fetchmailrc config file and edit it:
sudo nano /etc/fetchmailrc
Paste the following lines into fetchmailrc and edit to suit:
set daemon 60 set invisible set no bouncemail set syslog poll pop3.example.com protocol pop3 username "email@example.com" password "password" mda "/usr/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt/" no keep ; poll pop3.example.com protocol pop3 username "firstname.lastname@example.org" password "password" mda "/usr/bin/rt-mailgate --queue general --action comment --url http://localhost/rt/" no keep ;
Important: If you changed the Queue Name during RT Web Configuration, you need to modify the queue name in fetchmailrc or incoming email will not work.
Restart the RT host and while you are waiting send an email to RT (eg email@example.com) from your email account.
Once the server is back fetchmail should retrieve the email within 60 seconds & forward it to RT. You will then get an email reply and the newly created ticket should appear in the web interface.
There are a few jobs which you will want to run regularly. The easiest way is to add these to cron:
sudo crontab -e
Add the following lines then save and exit:
0 0 * * * /usr/sbin/rt-email-digest -m daily 0 0 * * 0 /usr/sbin/rt-email-digest -m weekly 0 * * * * /usr/sbin/rt-email-dashboards
Request Tracker should now be running and tickets can be received. You should create a group for your IT team with increased permissions to the queue, and add your team members to it. I also strongly recommend establishing a regular backup schedule for at least the RT database.
Over the next few months I will try to add more RT howto’s including adding queues, integrating with an AD domain, and enabling fast full-text searching.
Request Tracker Links