View Source:
RequestTrackerOnCentos5
Note:
This page has been locked and cannot be edited.
!!! ~RequestTracker on CentOS 5 I recently assisted a friend in installing and configuring the latest [Request Tracker|http://bestpractical.com/rt/] issue tracking system. There didn't seem to be good instructions about this on the web so I've written up my notes as a walkthrough here. These notes are specific to installing RT on a ~CentOS 5 ~GoDaddy VPS running over SSL but there should be enough generic info to cover any RT install on a modern linux system. !! Initial Download and Configuration Run <code>yum update</code> beforehand to ensure you have the latest versions of all the system packages. Get the RT source [from bestpractical|http://download.bestpractical.com/pub/rt/release/rt.tar.gz]. I followed these [initial instructions| http://requesttracker.wikia.com/wiki/CentOS5InstallPlusSome] although they are geared towards the older RT 3. Next download needed perl updates via CPAN. Start the cpan shell with <code>sudo perl -MCPAN -e shell</code>. Set cpan to [auto-follow dependencies| http://rackerhacker.com/2009/01/01/cpan-automatically-install-dependencies-without-confirmation/] by entering this in the cpan shell: <verbatim> o conf prerequisites_policy follow o conf commit </verbatim> Then <code>install ~Bundle::~CPAN</code> to get all your perl dependencies current. <code>reload cpan</code> and <code>reload index</code> so your perl install is all current. It seems to [not matter if you use fastcgi or mod_perl|http://requesttracker.wikia.com/wiki/ManualApacheConfig#FastCGI_vs._mod_perl]. I used mod_perl since it was already installed on the system, along with Apache 2.2. The default version of perl is the old 5.8.8 but [upgrading looks too painful|http://serverfault.com/questions/167234/upgrade-perl-on-centos-5-5-to-version-5-10]. Untar the rt source package and configure it: <verbatim> $ tar zxvf rt.tar.gz $ cd rt-4.0.1 $ ./configure </verbatim> I just used the defaults for all the configure settings. <verbatim> $ cd rt-4.0.1 $ make fixdeps $ make testdeps </verbatim> If <code>make testdeps</code> still complains, try running <code>make fixdeps</code> again. Finally run <code>sudo make install</code> to actually install rt under <code>/opt/rt4</code>. !! RT-Specific Setup, Mail Setup Edit =/opt/rt4/etc/RT_~SiteConfig.pm= to configure your site-specific settings. Here's what I used: <verbatim> Set($rtname , "example.com"); Set($Organization , "example"); Set($MinimumPasswordLength , "5"); Set($Timezone , 'US/Pacific'); Set($DatabaseType , 'mysql'); Set($DatabaseHost , 'localhost'); Set($DatabaseRTHost , 'localhost'); Set($DatabasePort , ''); Set($DatabaseUser , 'XXXXXXXX'); Set($DatabasePassword , 'YYYYYYYY'); Set($WebPath , "/rt"); #Set($WebDomain, "example.com"); Set($WebPort , 443); Set($WebBaseURL , "https://example.com"); Set($WebURL , $WebBaseURL . $WebPath . "/"); Set($DatabaseName , 'rt4'); Set($RTAddressRegexp , '^rt(-\S+|-\S+-comment)?\@(www\.)?example.com$'); Set($CorrespondAddress , 'no-reply@example.com'); Set($CommentAddress , 'no-reply@example.com'); </verbatim> Set up your mysql database with <code>sudo make initialize-database</code>. Enter password =YYYYYYYY= from above when prompted and the mysql database will be completely autoconfigured. Next set up the root crontabs with <code>sudo crontab -e</code>: <verbatim> 0 0 * * * /opt/rt4/sbin/rt-email-digest -m daily 0 0 * * 0 /opt/rt4/sbin/rt-email-digest -m weekly 0 * * * * /opt/rt4/sbin/rt-email-dashboards </verbatim> Edit /etc/aliases and add: <verbatim> rt: "|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url https://rt.example.com/rt" rt-comment: "|/opt/rt4/bin/rt-mailgate --queue general --action comment --url https://rt.example.com/rt" </verbatim> then run <code>sudo newaliases</code> to regenerate the aliases database. I had to fix up <code>/etc/postfix/main.cf</code> because the stupid godaddy vps [blocks outgoing port 25|http://www.stemkoski.com/godaddy-dedicated-server-hosting-blocks-port-25/]. ~GoDaddy sucks, use a different VPS service. Assuming that your host is the authoritative mail sever for the domain, and the only server in your domain (no relaying), your main.cf should look something like this: <verbatim> myhostname = www.example.com mydomain = example.com myorigin=$mydomain inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks_style = host # brackets to disable mx lookups! relayhost = [s2smtpout.secureserver.net] </verbatim> Now it's time to fix up the host spamassassin configuration, by default it runs as user nobody and generates errors in logs because user nobody has homedir =/=. first fix =/etc/sysconfig/spamassin=: <verbatim> SPAMDOPTIONS="-d -c -m5 -u spamd -H /var/log/spamassassin -x" </verbatim> then create a spamd user: <verbatim> $ sudo /usr/sbin/groupadd spamd $ sudo /usr/sbin/useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd </verbatim> After that you need to restart spamassassin with =/etc/init.d/spamassassin restart= With that mail should be flowing through spamassassin correctly. Check =/var/log/maillog= to confirm. Don't forget to open port 25 to incoming mail in your firewall: <verbatim> /sbin/iptables -I INPUT 5 -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT </verbatim> Add that to =/etc/sysconfig/iptables= to make it permanent: <verbatim> -A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT </verbatim> Create =/etc/httpd/conf.d/rt4.conf= with following contents: <verbatim> # RequestTracker <Location /rt> Order allow,deny Allow from all SetHandler modperl PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /opt/rt4/sbin/rt-server </Location> <Perl> use Plack::Handler::Apache2; Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server"); </Perl> # force rt over https always RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} rt RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] </verbatim> To test, point your web browser at <code>http://example.com/rt</code>. You should see the location bar url magically turn into =https=. !! Initial Login and User Setup For your first login through the RT web interface, use username =root=, password =password=. Change it immediately! Next in the RT web interface, create a real admin user through =tools->configuration->users->create=: * username: =user= * email: =user@yahoo.com= * email address should be the users's real email address somewhere else. * real name: =Some User= * check =Let This User Access RT= * check =Let This User Be Granted Rights= * enter root's password * enter new password twice for this user * click =save changes= Next make this user a super-user via =tools->configuration->global->user rights=. * enter new user in =user name= field on left * click on =rights for administrators= tab * check =Do Anything and Everything= * click =save changes= Then you need to make a corresponding user on the system: * log on to server * =sudo /usr/sbin/useradd -c "Real Name" username= * (username must match RT username) * =sudo /usr/bin/passwd usename= * set user password to match RT password * edit =~username/.forward= * add line pointing to user's real external email address !! Creating A New Queue You will probably want to create one or more ticket queues to use, although you can if you want skip this step and just use the default =general= queue for everything. Log in as root and go to =tools->configuration->queues->create=. Create a queue as follows: * queue name: =Customer1= * description: =Test Queue for Customer 1= * reply address: =rt-customer1@example.com= * comment address: =rt-customer1-comment@example.com= Allow anyone to create new tickets in the queue via email, =tools->configuration->queues->select=. * choose =Customer1= queue * click =user rights= tab * go to =everyone->general rights->create tickets= * click =save changes= Now you need to create mail addresses for your new queue. Edit /etc/aliases and add: <verbatim> rt-customer1: "|/opt/rt4/bin/rt-mailgate --queue Customer1 --action correspond --url https://rt.example.com/rt" rt-customer1-comment: "|/opt/rt4/bin/rt-mailgate --queue Customer1 --action comment --url https://rt.example.com/rt" </verbatim> then run <code>sudo newaliases</code> to regenerate the aliases database. </verbatim> Obviously manually creating email aliases for every queue can be cumbersome. Various people have put together mechanisms to automate that step using procmail and such. Google it if you're interested as I can't find my link. !! Conclusion Ok there you have it - a complete RT setup on ~CentOS 5, over SSL, with a user and a couple queues. Should be enough to get you started. Please let me know if I missed anything in this guide. CategoryGeekStuff CategoryBlog
Please enable JavaScript to view the
comments powered by Disqus.
HollenbackDotNet
Home Page
Popular Pages
All Categories
Main Categories
General Interest
Geek Stuff
DevOps
Linux Stuff
Pictures
Search
Toolbox
RecentChanges
RecentNewPages
What links here
Printable version
AllPages
RecentChanges
Recent Changes Cached
No changes found
Favorite Categories
ActionPage
(150)
WikiPlugin
(149)
GeekStuff
(137)
PhpWikiAdministration
(102)
Help/PageList
(75)
Help/MagicPhpWikiURLs
(75)
Blog
(69)
Pictures
(60)
GeneralInterest
(44)
LinuxStuff
(38)
Views
View Page
View Source
History
Diff
Sign In