Request Tracker Tips
Scripts
Optimization
#!/usr/bin/perl
use lib qw(/usr/share/request-tracker3.6/lib); use RT; RT::LoadConfig(); RT::Init(); $RT::Handle->SimpleQuery("delete from sessions where LastUpdated < (now() - interval 24 hour)");
Howto
Request tracker 3.8.2 (Ubuntu-LTS) + NGINX + PostgreSQL
wget http://download.bestpractical.com/pub/rt/release/rt-3.8.2.tar.gz tar -xvzf rt-3.8.2.tar.gz make testdeps make fixdeps apt-get install mysql-client apt-get install libdbd-pg-perl libclass-dbi-pg-perl make testdeps make install
Upgrading PostgreSQL database
## make upgrade /opt/rt3/sbin/rt-setup-database --dba rtuser --prompt-for-dba-password --action upgrade
NGINX setup
Useful links:
FCGI/init script
f /etc/init.d/rt.fcgi
#!/bin/sh RTPATH=/opt/rt3 RTUSER=www-data #FCGI_SOCKET_PATH=$RTPATH/var/fastcgi FCGI_SOCKET_PATH=/tmp/rt.fcgi case $1 in start) echo -n "Starting RT: mason_handler.fcgi" cd $RTPATH export FCGI_SOCKET_PATH su $RTUSER -c "$RTPATH/bin/mason_handler.fcgi" & echo ;; stop) echo -n "Stopping RT: " PIDS=`ps axww | awk '/[m]ason_handler.fcgi/ { print $1}'` if [ -n "$PIDS" ] then echo -n kill -TERM $PIDS kill $PIDS echo else echo RT not running fi ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/rt { stop | start | restart }" exit 1 ;; esac
nginx request-tracker vhost config
f /etc/nginx/sites-enable/rt
server { listen 80; server_name rt.xxxx.si; access_log /var/log/nginx/rt.xxxx.si-access.log; location / { fastcgi_pass unix:/tmp/rt.fcgi; #fastcgi_x_powered_by off; # default on fastcgi_param DOCUMENT_ROOT /opt/rt3/share/html; fastcgi_param SCRIPT_FILENAME /opt/rt3/share/html$fastcgi_script_name; fastcgi_param PATH_TRANSLATED /opt/rt3/share/html$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param SERVER_SOFTWARE "nginx/0.3.15"; fastcgi_param GATEWAY_INTERFACE "CGI/1.1"; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_NAME $server_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param REMOTE_USER $remote_user; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; } location ~* .+\.(html|js|css)$ { fastcgi_pass unix:/tmp/rt.fcgi; #fastcgi_x_powered_by off; # default on fastcgi_param DOCUMENT_ROOT /opt/rt3/share/html; fastcgi_param SCRIPT_FILENAME /opt/rt3/share/html$fastcgi_script_name; fastcgi_param PATH_TRANSLATED /opt/rt3/share/html$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param SERVER_SOFTWARE "nginx/0.3.15"; fastcgi_param GATEWAY_INTERFACE "CGI/1.1"; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_NAME $server_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param REMOTE_USER $remote_user; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; } location /NoAuth/images/ { alias /opt/rt3/share/html/NoAuth/images/; } }
adding RTFM
Download RTFM
tar -xzvf rtfm.tar.gz
Install and patch the database
cd RTFM-2.4.0 perl Makefile.PL make install make initdb
add follwing line to /opt/rt3/etc/RT_SiteConfig.pm
Set(@Plugins,qw(RT::FM));
Changing user pref "Illegal value for EmailAddress"
If you try to change your email and RT returns you an error “Illegal value for EmailAddress
“ means that this email address is already in the database. Workaround:
as root Configuration → Users → Find people whose Email is '<email>' and also checkbox Include disabled users in search. Edit user by this email and remove RT permissions and email. Now you can change your original account.
Installing RT 3.8.1 / Debian
good article on this topic on http://rtvm.tehcorner.com/rt38/