May 052008
 

Sponsored Link

RT is an industrial-grade trouble ticketing system. It lets a group of people intelligently and efficiently manage requests submitted by a community of users. RT is used by systems administrators, customer support staffs, NOCs, developers, and even marketing departments to track issues, outages, bugs, requests, and all kinds of other things at thousands of sites around the world.

This tutorial will explain how to install and configure Request-Tracker 3.6 on Debian Etch with postfix and fetchmail, use fetchmail to retrieve emails from the mail server and inject them into RT.

Preparing your system

Install Postfix, fetchmail using the following command

#apt-get install postfix fetchmail

Select “Internet Site” when prompted

Install MySQL Server 5 using the following command

#aptitude install mysql-server-5.0

Install Request-Tracker Apache2 package using the following command

#aptitude install rt3.6-apache2

Install Request-Tracker 3.6 using the following command

#aptitude install request-tracker3.6

Configuring Request Tracker

Request Tracker Configuration file located at /etc/request-tracker3.6/RT_SiteConfig.pm you need to edit this file using the following command and change the required configuration.

# vi /etc/request-tracker3.6/RT_SiteConfig.pm

# RT_SiteConfig.pm
#
# These are the bits you absolutely *must* edit.
#
# To find out how, please read
# /usr/share/doc/request-tracker3.6/NOTES.Debian

# THE BASICS:

Set($rtname, ‘support.example.org');
Set($Organization, ‘example.org');

Set($CorrespondAddress , ‘[email protected]');
Set($CommentAddress , ‘[email protected]');

Set($Timezone , ‘Europe/Brussels'); # obviously choose what suits you

# THE DATABASE:

Set($DatabaseType, ‘mysql'); # e.g. Pg or mysql

# These are the settings we used above when creating the RT database,
# you MUST set these to what you chose in the section above.

Set($DatabaseUser , ‘rtuser');
Set($DatabasePassword , ‘wibble');
Set($DatabaseName , ‘rtdb');

# THE WEBSERVER:

Set($WebPath , "/rt");
Set($WebBaseURL , "http://host.example.org");

Mysql Database Configuration

Create MySQL user

First set up root password

# mysqladmin -u root password myrootpassword

Create the user “rtuser” :

mysql -u root -p

mysql> GRANT ALL PRIVILEGES ON rtdb.* TO ‘rtuser'@'localhost' IDENTIFIED BY ‘wibble'; FLUSH PRIVILEGES; QUIT

Set up RT database :

# /usr/sbin/rt-setup-database-3.6 --action init --dba root --prompt-for-dba-password

You should see something like the following :

Password:
Now creating a database for RT.
Creating mysql database rtdb.
Now populating database schema.
Creating database schema.
readline() on closed filehandle SCHEMA_LOCAL at /usr/sbin/rt-setup-database-3.6 line 223.
Done setting up database schema.
Now inserting database ACLs
Done setting up database ACLs.
Now inserting RT core system objects
Checking for existing system user…not found. This appears to be a new installation.
Creating system user…done.
Now inserting RT data
Creating Superuser ACL…done.
Creating groups…3.4.5.6.7.8.9.done.
Creating users…10.12.done.
Creating queues…1.2.done.
Creating ACL…2.3.done.
Creating ScripActions…1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.done.
Creating ScripConditions…1.2.3.4.5.6.7.8.9.10.done.
Creating templates…1.2.3.4.5.6.7.8.9.10.11.12.done.
Creating scrips…1.2.3.4.5.6.7.8.9.10.11.12.13.14.done.
Creating predefined searches…1.2.3.done.
Done setting up database content.

Configuring Apache

Set up Apache2

Add the following to /etc/apache2/sites-enabled/000-default

Paste at the end of the file just before the closing virtualhost tag

Include "/etc/request-tracker3.6/apache2-modperl2.conf"
RedirectMatch ^/$ /rt/

Enable mod rewrite

# cd /etc/apache2/mods-enabled/

# ln -s ../mods-available/rewrite.load .

Restart Apache2

# /etc/init.d/apache2 restart

Finally you need to login to rt and grant CreateTicket and ReplyToTicket to the group Everyone.

http://host.example.org/rt/

Login as user “root”
Password is “password”

Configuration > Global > Group rights

Set up a queue :

Configure > Queue > New queue

You can rename the general queue to whatever you want

Create your first SuperUser :

Configure > Users > New User

We’ll call it SupportJedi

Then :

Configure > Global > User Rights > Set SuperUser right to SupportJedi

You may want to edit the templates provided by RT by default :

Configuration > Global > Templates

The most interesting templates are autoreply and resolved.

Configuring Fetchmail

Setting up fetchmail

Edit /etc/default/fetchmail

# vim /etc/fetchmailrc

Set START_DAEMON=yes

save and exit the file

Prepare log files

# touch /var/log/fetchmail.log

# chown fetchmail /var/log/fetchmail.log

Edit /etc/fetchmailrc

set daemon 60
set invisible
set no bouncemail
set no syslog
set logfile /var/log/fetchmail.log

# [email protected]
poll pop.example.org
protocol pop3
username "login-of-support-mailbox" password "verysecretpassword"
mda "/usr/bin/rt-mailgate-3.6 --queue support --action correspond --url http://support.example.org/rt/"
no keep

# [email protected]
poll pop.example.org
protocol pop3
username "login-of-supportcomment-mailbox" password "verysecretpassword"
mda "/usr/bin/rt-mailgate-3.6 --queue support --action comment --url http://support.example.org/rt/"
no keepThis howto assumes the mailboxes are created on the email gateway, it’s going beyond the scope of this article though.

The mda line tells fetchmail what to do upon reception of a new email.

You can select the queue in which the mail should be injected, the action can either be “correspond” for customer correspondances while “comment” is for internal comments on a ticket.

Restart Fetchmail

# /etc/init.d/fetchmail restart

Logs go in /var/log/fetchmail.log

You can now try to send an email to support@example[email protected], the mail would be retrieved by fetchmail and injected into RT.
The requestor will receive an autoreply email (see template autoreply).

Configuration tips

1. You should set up an “Administrative CC” on the support queue. You’ll get an email notice whenever a new ticket is created or a reply from the customer has been received.

2. I noticed that if you create a ticket from the web interface of RT and add an email address in the CC field, the email specified in the CC will not get the email at the creation of the ticket, only on response made to it. (while AdminCC’s are notified)

You must create a new scrip in Configuration > Global > Scrips with the following properties :
On Create Notify Ccs with template Correspondence

Sponsored Link

 Posted by at 1:29 am

  20 Responses to “Howto setup Request-Tracker 3.6 on Debian Etch”

  1. Hi all,

    I tried to install all stuff on Debian Etch. It looks all works fine but attachments not. I create a new ticket attach a file (fe .jpg) and save it. Then i can see new ticket with attachment link. But after link click it redirect to url (http://myserver/rt/Ticket/Attachment/122/62/flv.jpg) there is no content – corrupted image ikon.

    Note that the source file before upload isn’t corrupted. Any suggestions? I checked the database “Attachments” table. I can see the binary content of uploaded image. Of course I don’t know the binary content in database is ok. I guess it is :-)

  2. Hi,

    thank you very much for this usefull manual! it has worked perfectly for me!

  3. @michal: it’s the attachments table that’s broken. this is an old bug in RT that has yet to be properly resolved. change the Content field in the Attachments table to ‘longblob’ and your attachments will work.


    mysql> alter table Attachments change Content Content longblob;

  4. root@ASL-GW:~# pico /etc/apache2/sites-enabled/000-default
    root@ASL-GW:~# /etc/init.d/apache restart
    * Restarting web server apache2 * We failed to correctly shutdown apache, so we’re now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you’d expect now!
    Syntax error on line 17 of /etc/request-tracker3.6/apache2-modperl2.conf:
    Invalid command ‘PerlModule’, perhaps misspelled or defined by a module not included in the server configuration
    [fail]

    what to do?

  5. Great article, worked for me. thanks – any chance of doing one for rtfm on the same system?

  6. Hi

    I got it to work, but when I setup the superuser I must have done something wrong. I can’t see the configuration menu anymore. I can’t add any users or change any settings. How canI get it back to defaults?

    Regards,
    Jaco

  7. I get the same problem as Mamun:

    Starting web server: apache2Syntax error on line 16 of /etc/request-tracker3.6/apache2-modperl2.conf:
    Invalid command ‘PerlModule’, perhaps misspelled or defined by a module not included in the server configuration
    failed!

    Line 16 is:
    PerlModule Apache2::RequestRec Apache2::compat

    So the command “PerlModule” doesn’t work. I double-checked that the ‘mod-perl’ package was installed, then (re) added a symlink from /etc/apache2/mods-enabled to ../mods-available/perl.load. That fixed the ‘PerlModule’ error, but a DBI one came up.

    It turns out that libapache-dbi-perl somehow became de-installed (man I hate debian), so I reinstalled it, and that did the trick.

  8. Your instructions to insert
    Include “/etc/request-tracker3.6/apache2-modperl2.conf”
    into /etc/apache2/sites-enabled/000-default, did not work on my vanilla Ubuntu 8.04 64-Bit Server (+LAMP, +SSDD) install.

    The quotation marks needed to be removed leaving
    Include /etc/request-tracker3.6/apache2-modperl2.conf

  9. hello, i got 2 problems.

    – directly after install RT te webserver will run and i become the login promt, very fine !! but .. after the Login it is impossible to save any settings :(

    – after a reboot, apache cannot start cause the rights of the webserver and the file “/etc/request-tracker3.6/RT_SiteConfig.pm” are different. What is the right way ?? www-data or root ?

    Please help me, i find its a mess that RT makes so big trouble. Im not a great Linux-Guru, bit i mean it should be easyer to install a software in this time. But your Description is really good until my to problems :(

    waiting for helpfully feedback!

    best Regards!!

  10. Claudio,
    For the saving of settings, make sure you can log into your mysql/whatever database with the user and password you used in the setup of RT. probably
    #mysql -u rtuser -p
    then hit enter and you will be prompted for a password.. enter the password, and you (hopefully) will see a
    mysql>
    at which point you are in the database. To exit, use
    quit;

    for the apache, use www-data, not root

    I’d venture to say it may be simpler for you to completely remove and reinstall RT:
    apt-get –purge remove rtfm-3.6 request-tracker3.6
    and then do a reinstall.
    Good luck.
    V

  11. Everybody getting the “Invalid command ‘PerlModule’, perhaps misspelled or defined by a module not included in the server configuration
    failed! ” error has to activate the perlmod module.

    This is done by:

    > cd /etc/apache2/mods-enabled
    > ln -s /etc/apache2/mods-available/perl.load

    After that (re)start the apache with the modified ‘000-default’ file and everything should be fine.

  12. Great write up! Its really appreciated.

    It’d be nice if you could include an alternative to fetchmail (ie, if the server runs its own mail server)

  13. Hi

    Could somebody tell me how assign a default group to user when the user is automaticaly created in your first login through SelfService screen?

    Thank you very much

    Julio

  14. I keep getting the following when restarting apache:

    ... waiting Syntax error on line 44 of /etc/apache2/sites-enabled/000-default:
    Invalid command 'Enable', perhaps misspelled or defined by a module not included in the server configuration
    failed!

    and line 44 is:

    Enable mod rewrite

    What should it say? Could you please modify the tutorial to reflect this? Thanks!

  15. I followed the tutorial and successfully installed! Thank you so much! However, there are some changes I’d like to submit and please verify them if you have time:

    When issuing the command:
    #aptitude install request-tracker3.6
    and a blue setup screen asks if you want to use dbconfig-common, do not select this option in order to adhere to the tutorial. It will configure the database but it eliminates the use of the command:
    # /usr/sbin/rt-setup-database-3.6 --action init --dba root --prompt-for-dba-password

    Also, you state in the tutorial “Enable mod rewrite”. I was assuming this was an entry to be pasted in /etc/apache2/sites-available/000-default per the previous lines that said “put this in the 000-default file”. I advise you change it to say:

    “Enable the mod rewrite module by typing:”
    a2enmod rewrite

    I just got to the point where I can login to RT and thought I’d make those suggestions. In any event thank you for putting this up.

  16. I’m about to install it and I hope it works
    Kind regards

    Clarence

  17. Hello and thanks for your great guide.
    I got stuck on setting up fetchmailrc with the mail gateway. when i restart fetchmail it says:

    i installed 3.8

    mda “/usr/bin/rt-mailgate-3.8 –queue support –action comment –url http://support.example.org/rt/”
    no keep

    Starting mail retriever agent: fetchmailfetchmail:/etc/fetchmailrc:11: syntax error at –queue
    failed!

    This howto assumes the mailboxes are created on the email gateway, it’s going beyond the scope of this article though.

    the amail gateway, what do you mean?

    thanks

    /Martin

  18. hi all,

    can anyone please give me a system configuration for Request tracker.

    Thanks in advance..

  19. Hi Great write up is right. I have been reading everywhere about rt. I recently have been made responsible for rt system(no training). Every time a report runs it fails on rt. Example
    We are running rt-3.8.6.

    Being suspicious I decided to run basic sql commands to see if I can login. Mind you I can log into the system via http.

    Here is the request tracker report….

    rt3# /usr/local/bin/rt ls -i “Created > ‘1 Year Ago’ AND Status != ‘resolved'” -o -Created | xargs /usr/local/bin/report.pl
    rt: Incorrect username or password.

    What does this mean???? How to a fix this?

    I ran same command below with these results thinking that I should be able to login.

    rt3# mysql -u chris.bender@localhost -p
    Enter password:
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

  20. hey i did in rt4 so if anyone know the configuration for the mail plzz help me

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>