OpenSuSE114InstallPlus

From Request Tracker Wiki
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 page 'OpenSuSE114InstallPlus' is tagged as OUTDATED
This page contains out of date and possibly misleading information or instructions such as installation methods or configuration examples that no longer apply. Please consider this warning when reading the page below.
If you have checked or updated this page and found the content to be suitable, please remove this notice by editing the page and remove the Outdated template tag.



Introduction

This guide will show you how to build out RT and more using packages we'll be building as we go. This allows you to a) learn how to install RT, and b) use the package manager that the OS provides without running into all sorts of issues with file conflicts, etc.....

General Setup

First, before we get into it, install a vanilla OpenSuSE 11.3 system. Now, open a root shell and run the following command:

zypper install apache2 apache2-mod_perl apache2-prefork apache2-utils \
           apache2-worker libapr-util1-devel libapr1-devel \
           perl-Apache-DBI limal-perl perl pcre perl-Archive-Tar \
           mysql mysql-Max mysql-client perl-DBD-mysql lftp ncftp curl \
           wget sqlite3-devel nano patch make m4 lynx gcc gd-devel \
           graphviz-devel graphviz-perl perl-Locale-Maketext-Lexicon \
           perl-Time-modules perl-Text-Template perl-Regexp-Common \
           perl-Log-Dispatch perl-UNIVERSAL-require perl-MIME-Types \
           perl-PerlIO-eol perl-HTML-Format perl-Apache-Session \
           perl-Net-Server perl-Test-Pod-Coverage perl-Test-Pod \
           perl-Test-Deep perl-Sub-Uplevel perl-Tree-DAG_Node \
           perl-Test-Warn perl-Test-Exception perl-Sub-Name perl-Data-OptList \
           perl-Task-Weaken perl-List-MoreUtils perl-Sub-Exporter \
           perl-GDGraph perl-GDTextUtil perl-DateTime perl-FreezeThaw \
           perl-Clone perl-Class-Inspector perl-MIME-tools perl-FastCGI \
           perl-IPC-Run perl-ldap perl-ldap-ssl

Now setup CPAN to be useful for your area by running the following command and follow the prompts:

cpan

(Read the docs on CPAN, I'm not going to go into how to follow the prompts....)

Set up your system to build RPMS. (There are loads of really good RPM HowTos out there, so I'm not going to cover the specifics here for that....)

Now go get the latest version of the cpan2rpm source package at http://perl.arix.com/cpan2rpm/. Once downloaded, run the following command to build it for your platform:

rpm -ivh cpan2rpm-2.028-1.src.rpm
rpmbuild -ba SPECS/cpan2rpm.spec
rpm -ivh RPMS/noarch/cpan2rpm-2.028-1.noarch.rpm

Download the tarballs for RT and RTFM (as of this writing 3.8.8 and 2.4.3rc1 respectively).

RT's Dependencies

Now, to make this work, you'll need to build a number of packages of stuff from CPAN. The cpan2rpm tool, while handy doesn't do the spec files 100% correctly, so there is a little hand editing you'll have to do to all of them. The changes are small, just remove the if/fi statement under the comment about SuSE Linux in each. That and if you're a stickler for completeness, you might want to fill in the %description section for the modules that the POD is poorly written for that can't be parsed.... Note, when I did this, I installed them right after building them, this allows them to pick up their dependencies for build. The list of packages you'll need to build are:

Devel::StackTrace
Class::ReturnValue
Text::Reform
Text::Autoformat
Text::Quoted
Test::LongString
CSS::Squish
HTTP::Server::Simple
Cache::Cache
Class::Container
Class::Data::Inheritable
Exception::Class
Log::Any
HTML::Mason
Hook::LexWrap
HTTP::Server::Simple::Mason
HTML::RewriteAttributes
Class::Accessor
Class::Accessor::Chained
Text::vFile::asData
Data::ICal
Try::Tiny
Params::Util
Sub::Install
Package::DeprecationManager
MRO::Compat
Package::Stash
Scope::Guard
Devel::GlobalDestruction
Class::MOP
Moose
Mouse
Any::Moose
GnuPG::Interface
HTML::Scrubber
Calendar::Simple
Locale::Maketext::Fuzzy
DBIx::DBSchema
Want
Cache::Simple::TimedExpiry
DBIx::SearchBuilder
capitalization
File::ShareDir
Text::Wrapper
Module::Versions::Report
Tree::Simple
Email::Address
Test::Manifest
DateTime::Format::Mail
DateTime::Format::W3CDTF
XML::RSS
IPC::Run::SafeHandles
GraphViz

Once built, install them with the normal RPM installation routine. Now that we've all the dependencies installed, lets work on the RPM for RT itself

Getting Patches and Extra Files for the RPM

First we need three additional files along with our RT tarball to build RT. These files are used by the spec file we'll create in a bit. The first, and most important, is the patch that makes building as a non-root user possible:

Fig 1 - rt-3.8.8-enable-build-as-non-root.patch


--- rt-3.8.8/Makefile.in        2010-08-13 01:44:38.019382492 -0700
 +++ rt-3.8.8/Makefile.in        2010-08-14 00:32:15.567053724 -0700
 @@ -327,10 +327,10 @@
         chmod 0640 $(DESTDIR)$(SITE_CONFIG_FILE)
 
         # Make the system binaries
 -       cd $(DESTDIR)$(RT_BIN_PATH) && ( chmod 0755 $(BINARIES) ; chown $(BIN_OWNER) $(BINARIES);  chgrp $(RTGROUP) $(BINARIES))
 +       cd $(DESTDIR)$(RT_BIN_PATH) && ( chmod 0755 $(BINARIES) ; chown $(BIN_OWNER) $(BINARIES); )
 
         # Make the system binaries executable also
 -       cd $(DESTDIR)$(RT_SBIN_PATH) && ( chmod 0755 $(SYSTEM_BINARIES) ; chown $(BIN_OWNER) $(SYSTEM_BINARIES);  chgrp $(RTGROUP) $(SYSTEM_BINARIES))
 +       cd $(DESTDIR)$(RT_SBIN_PATH) && ( chmod 0755 $(SYSTEM_BINARIES) ; chown $(BIN_OWNER) $(SYSTEM_BINARIES); )
 
         # Make the web ui readable by all.
         chmod -R  u+rwX,go-w,go+rX      $(DESTDIR)$(MASON_HTML_PATH) \
 @@ -372,9 +372,9 @@
  files-install: libs-install etc-install config-install bin-install sbin-install html-install local-install doc-install font-install
 
 config-install:-@COMMENT_INPLACE_LAYOUT@       $(INSTALL) -m 0755 -o $(BIN_OWNER) -g $(RTGROUP) -d $(DESTDIR)$(CONFIG_FILE_PAT$
 -@COMMENT_INPLACE_LAYOUT@       -$(INSTALL) -m 0440 -o $(BIN_OWNER) -g $(RTGROUP)  etc/RT_Config.pm $(DESTDIR)$(CONFIG_FILE)
 -@COMMENT_INPLACE_LAYOUT@       [ -f $(DESTDIR)$(SITE_CONFIG_FILE) ] || $(INSTALL) -m 0640 -o $(BIN_OWNER) -g $(RTGROUP) etc/RT_SiteConfig.pm $(DESTDIR)$(SITE_CONFIG_FILE)
 +@COMMENT_INPLACE_LAYOUT@       $(INSTALL) -m 0755 -o $(BIN_OWNER) -d $(DESTDIR)$(CONFIG_FILE_PATH)
 +@COMMENT_INPLACE_LAYOUT@       -$(INSTALL) -m 0440 -o $(BIN_OWNER) etc/RT_Config.pm $(DESTDIR)$(CONFIG_FILE)
 +@COMMENT_INPLACE_LAYOUT@       [ -f $(DESTDIR)$(SITE_CONFIG_FILE) ] || $(INSTALL) -m 0640 -o $(BIN_OWNER) etc/RT_SiteConfig.pm $(DESTDIR)$(SITE_CONFIG_FILE)
  @COMMENT_INPLACE_LAYOUT@       @echo "Installed configuration. About to install RT in  $(RT_PATH)"
 
  test:
 @@ -458,7 +458,7 @@
  sbin-install:
  @COMMENT_INPLACE_LAYOUT@       $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_SBIN_PATH)
  @COMMENT_INPLACE_LAYOUT@       for file in $(SYSTEM_BINARIES) ; do \
 -@COMMENT_INPLACE_LAYOUT@           $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "sbin/$$file" "$(DESTDIR)$(RT_SBIN_PATH)/"; \
 +@COMMENT_INPLACE_LAYOUT@           $(INSTALL) -o $(BIN_OWNER) -m 0755 "sbin/$$file" "$(DESTDIR)$(RT_SBIN_PATH)/" ; \
  @COMMENT_INPLACE_LAYOUT@       done
 
  # }}}
 @@ -468,7 +468,7 @@
  bin-install:
  @COMMENT_INPLACE_LAYOUT@       $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_BIN_PATH)
  @COMMENT_INPLACE_LAYOUT@       for file in $(BINARIES) ; do \
 -@COMMENT_INPLACE_LAYOUT@           $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "bin/$$file" "$(DESTDIR)$(RT_BIN_PATH)/" ; \
 +@COMMENT_INPLACE_LAYOUT@           $(INSTALL) -o $(BIN_OWNER) -m 0755 "bin/$$file" "$(DESTDIR)$(RT_BIN_PATH)/" ; \
  @COMMENT_INPLACE_LAYOUT@       done
 
  # {{{ local-install
 

Next, we need the apache2 config file that enables RT:

Fig 2 - rt.conf.in


Alias /rt "@RT3_WWWDIR@"

PerlModule Apache::DBI
PerlRequire @RT3_BINDIR@/webmux.pl

<Directory "@RT3_WWWDIR@">
  AllowOverride All
  Options ExecCGI FollowSymLinks
  <ifModule mod_access.c>
     Order allow,deny
     Allow from all
  </ifModule>

  RewriteEngine On
  RedirectMatch permanent (.*)/$ $1/index.html
  AddDefaultCharset UTF-8
  SetHandler perl-script
  PerlHandler RT::Mason
</Directory>

Finally, for completeness sake, the README.openSUSE that will tell your other admins what to do AFTER installing the package:

Fig 3 - README.openSUSE.in


Some random notes on rt on OpenSuSE:
 
 Finalizing the installation
 ===========================
 
 The default configuration is set up for a mysql based rt system. It requires
 additional steps to be performed by the sysadmin to be fully functional.
 
 If you have never installed rt before, proceed as follows:
 1. Log-in to the server as root
 2. Startup the mysql server:
 
 # /sbin/service mysql start
 
 3. Install the RPMs following the tutorial at
     http://wiki.bestpractical.com/view/OpenSuSE113InstallPlus
 
 4. Edit /etc/rt3/RT_SiteConfig.pm to meet your demands.
 You will want to compare RT_SiteConfig.pm against RT_Config.pm and add
 customized versions of those settings from RT_Config.pm to RT_SiteConfig.pm.
 
 In particular, you probably will want to add customized versions of those
 setting containing "example.com" to your RT_SiteConfig.pm.
 
 5. Set up the mysql server.
 Set up a mysql root password.
 
 # mysqladmin -u root password <mysql-root-password>
 
 6. Start/restart apache/httpd:
 
 # /sbin/service apache2 restart
 
 7. Try to log in:
 At this point, you should be able to login into rt on your host via its web
 interface as administrator (root), from an arbitrary host with web access to
 your host. e.g.: <your-favorite-browser> http://<host>/rt
 
 You should be greeted with a login window. Login with 'root' sans quotes for
 the user, and 'password' sans quotes as the password.
 
 The next step should be to change the rt "root" account password, otherwise
 anyone with web access to your site will be able to abuse it.
 
 Afterwards, you should be ready to create user accounts, configure the
 mail-interface etc.
 

RT's RPM

Now on to the spec file for RT:

Fig 4 - rt.spec


%define RT_BINDIR               /srv/www/htdocs/rt/bin
 %define RT_LIBDIR               %{perl_vendorlib}
 %define RT_WWWDIR               /srv/www/htdocs/rt/html
 %define RT_LOGDIR               /srv/www/htdocs/rt/log
 %define RT_CACHEDIR             /srv/www/htdocs/rt/cache
 %define RT_LOCALSTATEDIR        /srv/www/htdocs/rt/state
 
 Name:           rt
 Version:        3.8.8
 Release:        1
 Summary:        Request tracker
 Group:          Applications/Internet
 License:        GPL
 URL:            http://www.bestpractical.com/rt
 Source0:        http://www.bestpractical.com/pub/rt/release/rt-%{version}.tar.gz
 Source3:        rt.conf.in
 Source4:        README.openSUSE.in
 Patch0:         rt-3.8.8-enable-build-as-non-root.patch
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 BuildRequires:  /usr/bin/pod2man
 BuildRequires:  /usr/sbin/apache2ctl
 BuildRequires:  perl-IPC-Run
 Requires:       apache2 mysql mysql-community-server postfix
 Requires(postun): /bin/rm
 AutoReqProv:    0
 Requires:       apache2-mod_perl apache2-prefork apache2-utils apache2-worker
 Requires:       libapr-util1 libapr1 perl-Apache-DBI limal-perl perl pcre
 Requires:       perl-Archive-Tar mysql-Max mysql-client perl-DBD-mysql lftp
 Requires:       ncftp curl wget sqlite3 lynx gd graphviz-perl perl(Locale::Maketext::Lexicon)
 Requires:       perl(Time::Timezone) perl(Text::Template) perl(Regexp::Common)
 Requires:       perl(PerlIO::eol) perl(HTML::Formatter) perl(Apache::Session)
 Requires:       perl(Net::Server) perl(Test::Pod::Coverage) perl(Test::Pod)
 Requires:       perl(Test::Deep) perl(Sub::Uplevel) perl(Tree::DAG_Node)
 Requires:       perl(Test::Warn) perl(Test::Exception) perl(Sub::Name) perl(Data::OptList)
 Requires:       perl(Task::Weaken) perl(List::MoreUtils) perl(Sub::Exporter)
 Requires:       perl(GD::Graph) perl(GD::Text) perl(DateTime) perl(FreezeThaw)
 Requires:       perl(Clone) perl(Class::Inspector) perl(MIME::Tools) perl(CGI) perl(CGI::Fast)
 Requires:       perl(IPC::Run) perl(Devel::StackTrace) perl(Class::ReturnValue)
 Requires:       perl(Text::Reform) perl(Text::Autoformat) perl(Text::Quoted) perl(Test::LongString)
 Requires:       perl(CSS::Squish) perl(HTTP::Server::Simple) perl(Cache::Cache)
 Requires:       perl(Class::Container) perl(Class::Data::Inheritable) perl(Exception::Class)
 Requires:       perl(Log::Any) perl(HTML::Mason) perl(Hook::LexWrap) perl(HTTP::Server::Simple::Mason)
 Requires:       perl(HTML::RewriteAttributes) perl(Class::Accessor) perl(Class::Accessor::Chained)
 Requires:       perl(Text::vFile::asData) perl(Data::ICal) perl(Try::Tiny) perl(Params::Util)
 Requires:       perl(Sub::Install) perl(Package::DeprecationManager) perl(MRO::Compat)
 Requires:       perl(Package::Stash) perl(Scope::Guard) perl(Devel::GlobalDestruction)
 Requires:       perl(Class::MOP) perl(Moose) perl(Mouse) perl(Any::Moose) perl(GnuPG::Interface)
 Requires:       perl(HTML::Scrubber) perl(Calendar::Simple) perl(Locale::Maketext::Fuzzy)
 Requires:       perl(DBIx::DBSchema) perl(Want) perl(Cache::Simple::TimedExpiry)
 Requires:       perl(DBIx::SearchBuilder) perl(capitalization) perl(File::ShareDir)
 Requires:       perl(Text::Wrapper) perl(Module::Versions::Report) perl(Tree::Simple)
 Requires:       perl(Email::Address) perl(Test::Manifest) perl(DateTime::Format::Mail)
 Requires:       perl(DateTime::Format::W3CDTF) perl(XML::RSS) perl(IPC::Run::SafeHandles)
 Requires:       perl(GraphViz)
 
 %description
 RT is an enterprise-grade ticketing system which enables a group of people
 to intelligently and efficiently manage tasks, issues, and requests submitted
 by a community of users.
 
 %prep
 rm -rf ${RPM_BUILD_ROOT}
 %setup -q -n rt-%{version}
 %patch0 -p1 -b non-root~
 
 sed -e 's,@RT3_CACHEDIR@,%{RT_CACHEDIR},' %{SOURCE4} \
   > README.openSUSE
 
 # Fixup the tarball shipping with broken permissions
 find . \( -name '*.pm' -o -name '*.pm.in' -o -name '*.po' -o -name '*.pod' \) \
   -exec chmod a-x {} \;
 chmod -x UPGRADING README C* aclocal.* config.* *.ac *.in
 find etc -type f -exec chmod a-x {} \;
 
 # Propagate rpm's directories to config.layout
 cat << \EOF >> config.layout
 
 #   openSUSE 11.3 directory layout.
 <Layout openSUSE113>
   bindir:               %{RT_BINDIR}
   sysconfdir:           %{_sysconfdir}/rt
   libdir:               %{RT_LIBDIR}
   sbindir:              %{RT_BINDIR}
   manualdir:            /srv/www/htdocs/rt/doc
   localstatedir:        %{RT_LOCALSTATEDIR}
   htmldir:              %{RT_WWWDIR}
   logfiledir:           %{RT_LOGDIR}
   masonstatedir:        %{RT_CACHEDIR}/mason_data
   sessionstatedir:      %{RT_CACHEDIR}/session_data
   customdir:            /srv/www/htdocs/rt/local
   custometcdir:         %{_sysconfdir}/rt/local/etc
   customhtmldir:        ${customdir}/html
   customlexdir:         ${customdir}/po
   customlibdir:         ${customdir}/lib
 </Layout>
 EOF
 
 # Comment out the Makefile trying to change groups/owners
 # Fix DESTDIR support
 sed -i \
         -e 's,  chgrp,  : chrgp,g' \
         -e 's,  chown,  : chown,g' \
         -e 's,$(DESTDIR)/,$(DESTDIR),g' \
 Makefile.in
 
 %build
 %configure \
 --prefix=/srv/www/htdocs/rt \
 --with-apachectl=/usr/sbin/apache2ctl \
 --with-web-user=wwwrun \
 --with-db-type=mysql \
 --with-db-dba=root \
 --with-db-host=localhost \
 --with-db-rt-user=rt \
 --with-db-rt-pass=rt-local-pass \
 --with-rt-group=rt \
 --enable-graphviz \
 --enable-gd \
 --enable-gpg \
 --with-web-group=www \
 --enable-layout=openSUSE113 \
 --libdir=%{RT_LIBDIR}
 make %{?_smp_mflags}
 
 # Generate man-pages
 /usr/bin/pod2man bin/rt-mailgate > bin/rt-mailgate.1
 /usr/bin/pod2man bin/mason_handler.fcgi > bin/mason_handler.fcgi.1
 
 %install
 rm -rf ${RPM_BUILD_ROOT}
 make DESTDIR=%{buildroot} install
 
 # Remove stuff we don't need....
 rm -f ${RPM_BUILD_ROOT}%{RT_BINDIR}/mason_handler.svc
 rm -rf ${RPM_BUILD_ROOT}%{RT_LIBDIR}/t
 rm -f ${RPM_BUILD_ROOT}%{RT_LIBDIR}/RT.pm.in
 # trash the fonts, we don't seem to need them
 # (If they are needed/used, please let me know so I can add them back to the package.)
 rm -f ${RPM_BUILD_ROOT}/*.README
 rm -f ${RPM_BUILD_ROOT}/*.ttf
 
 # Install the extra stuff we DO need....
 # Install apache configuration
 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/apache2/conf.d
 sed -e 's,@RT3_WWWDIR@,%{RT_WWWDIR},g' -e 's,@RT3_BINDIR@,%{RT_BINDIR},g' %{SOURCE3} > \
               ${RPM_BUILD_ROOT}%{_sysconfdir}/apache2/conf.d/rt.conf
 
 # man pages
 mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
 install -m 0644 bin/rt-mailgate.1 bin/mason_handler.fcgi.1 ${RPM_BUILD_ROOT}%{_mandir}/man1
 
 install -d -m755 ${RPM_BUILD_ROOT}%{_sysconfdir}/rt/local/etc
 install -d -m755 ${RPM_BUILD_ROOT}/srv/www/htdocs/rt/local/html
 install -d -m755 ${RPM_BUILD_ROOT}/srv/www/htdocs/rt/local/po
 install -d -m755 ${RPM_BUILD_ROOT}/srv/www/htdocs/rt/local/lib
 install -d -m755 ${RPM_BUILD_ROOT}%{RT_LOGDIR}
 install -d -m755 ${RPM_BUILD_ROOT}%{RT_LOCALSTATEDIR}
 
 # Fix permissions
 find ${RPM_BUILD_ROOT}%{RT_WWWDIR} -type f -exec chmod a-x {} \;
 
 %clean
 rm -rf ${RPM_BUILD_ROOT}
 
 %pre
 if [ $1 -eq 1 ]; then
     DOMAINNAME="`hostname -d`"
 
     # set up user credentials
     groupadd -g 200 rt
     useradd -g rt -u 200 -d /srv/www/htdocs/rt -s /sbin/nologin -c "RT" rt
     usermod -G rt wwwrun
 
     # enable needed services
     chkconfig apache2 on
     chkconfig mysql on
     chkconfig postfix on
 
     # add the mail aliases. Yes, this assumes that the host will have at least the CNAME rt.$your_domain.$tld
     echo "rt-helpdesk: \"|$RT_BINDIR/rt-mailgate --queue 'Helpdesk' --action correspond --url http://rt.$DOMAINNAME/rt/\"" >> /etc/aliases
     echo "rt-helpdesk-comment: \"|$RT_BINDIR/rt-mailgate --queue 'Helpdesk' --action comment --url http://rt.$DOMAINNAME/rt/\"" >> /etc/aliases
 
     newaliases
 
     # ensure all services are up
     /sbin/service apache2 restart
     /sbin/service mysql restart
     /sbin/service postfix restart
 fi
 
 %post
 if [ $1 -eq 1 ]; then
     echo -n "Initializing Request Tracker DB in MySQL.... "
     # this will fail if the DB has a root password....
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action init ||:
     echo "DONE"
 
     echo -n "Creating cron jobs.... "
     # set the cron jobs....
     echo "# RT Cron Jobs" >> /etc/crontab
     echo "0 0 * * * /opt/rt3/sbin/rt-email-digest -m daily" >> /etc/crontab
     echo "0 0 * * 0 /opt/rt3/sbin/rt-email-digest -m weekly" >> /etc/crontab
     echo "0 * * * * /opt/rt3/sbin/rt-email-dashboards" >> /etc/crontab
     echo "DONE"
 fi
 if [ $1 -eq 2 ]; then
     echo -n "Upgrading Request Tracker DB in MySQL.... "
     # remember, if this fails, you've a root password on your DB and I can't auto work for you.
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --dba root ||:
     echo "DONE"
 fi
 
 %postun
 if [ $1 -eq 0 ]; then
     echo -n "Deleting the HTML::Mason cache directory.... "
     /bin/rm -rf %{RT_CACHEDIR}
     echo "DONE"
     echo -n "Dropping the Request Tracker DB in MySQL.... "
     # this will fail if the DB has a root password.....
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action drop ||:
     echo "DONE"
     echo
 
     echo "++++++++++++++ REMINDER! ++++++++++++++++++++"
     echo "Unless you want cron to complain, remember "
     echo "to remove the extra cron jobs in the system "
     echo "crontab file in /etc.             "
     echo "+++++++++++++++++++++++++++++++++++++++++++++"
 fi
 
 %files
 %defattr(-,root,root,-)
 %doc COPYING README UPGRADING README.openSUSE
 %defattr(-,root,rt,-)
 %dir %{_sysconfdir}/rt
 %dir %{_sysconfdir}/rt/local/etc
 %defattr(-,root,root,-)
 %dir /srv/www/htdocs/rt/local
 %dir /srv/www/htdocs/rt/local/html
 %dir /srv/www/htdocs/rt/local/lib
 %dir /srv/www/htdocs/rt/local/po
 %defattr(-,root,root,-)
 %{_sysconfdir}/apache2/conf.d/*.conf
 %{_sysconfdir}/rt/acl.*
 %{_sysconfdir}/rt/initialdata
 %defattr(-,root,rt,-)
 %{_sysconfdir}/rt/RT_Config.pm
 %{_sysconfdir}/rt/RT_SiteConfig.pm
 %defattr(-,root,root,-)
 %{_sysconfdir}/rt/schema.*
 %defattr(-,root,rt,-)
 /srv/www/htdocs/rt/bin/*
 %defattr(-,root,root,-)
 /srv/www/htdocs/rt/doc
 /srv/www/htdocs/rt/html/*.html
 /srv/www/htdocs/rt/html/autohandler
 /srv/www/htdocs/rt/html/dhandler
 /srv/www/htdocs/rt/html/Admin/*.html
 /srv/www/htdocs/rt/html/Admin/autohandler
 /srv/www/htdocs/rt/html/Admin/CustomFields/*.html
 /srv/www/htdocs/rt/html/Admin/Elements
 /srv/www/htdocs/rt/html/Admin/Global/*.html
 /srv/www/htdocs/rt/html/Admin/Global/CustomFields/*.html
 /srv/www/htdocs/rt/html/Admin/Groups/*.html
 /srv/www/htdocs/rt/html/Admin/Queues/*.html
 /srv/www/htdocs/rt/html/Admin/Tools/*.html
 /srv/www/htdocs/rt/html/Admin/Tools/Shredder/*.html
 /srv/www/htdocs/rt/html/Admin/Tools/Shredder/autohandler
 /srv/www/htdocs/rt/html/Admin/Tools/Shredder/Dumps
 /srv/www/htdocs/rt/html/Admin/Tools/Shredder/Elements
 /srv/www/htdocs/rt/html/Admin/Users/*.html
 /srv/www/htdocs/rt/html/Approvals/*.html
 /srv/www/htdocs/rt/html/Approvals/autohandler
 /srv/www/htdocs/rt/html/Approvals/Elements
 /srv/www/htdocs/rt/html/Dashboards/*.html
 /srv/www/htdocs/rt/html/Dashboards/dhandler
 /srv/www/htdocs/rt/html/Dashboards/Elements
 /srv/www/htdocs/rt/html/Download
 /srv/www/htdocs/rt/html/Elements
 /srv/www/htdocs/rt/html/Helpers
 /srv/www/htdocs/rt/html/Install/*.html
 /srv/www/htdocs/rt/html/Install/autohandler
 /srv/www/htdocs/rt/html/Install/Elements
 /srv/www/htdocs/rt/html/l
 /srv/www/htdocs/rt/html/NoAuth/*.html
 /srv/www/htdocs/rt/html/NoAuth/css/*.css
 /srv/www/htdocs/rt/html/NoAuth/css/3.4-compat/*.css
 /srv/www/htdocs/rt/html/NoAuth/css/3.5-default/*.css
 /srv/www/htdocs/rt/html/NoAuth/css/autohandler
 /srv/www/htdocs/rt/html/NoAuth/css/base/*.css
 /srv/www/htdocs/rt/html/NoAuth/css/dhandler
 /srv/www/htdocs/rt/html/NoAuth/css/web2/*.css
 /srv/www/htdocs/rt/html/NoAuth/css/web2/InHeader
 /srv/www/htdocs/rt/html/NoAuth/css/web2/images/dhandler
 /srv/www/htdocs/rt/html/NoAuth/css/web2/images/source/*.png
 /srv/www/htdocs/rt/html/NoAuth/iCal/dhandler
 /srv/www/htdocs/rt/html/NoAuth/images/*.gif
 /srv/www/htdocs/rt/html/NoAuth/images/*.png
 /srv/www/htdocs/rt/html/NoAuth/images/autohandler
 /srv/www/htdocs/rt/html/NoAuth/images/css/*.gif
 /srv/www/htdocs/rt/html/NoAuth/images/css/*.png
 /srv/www/htdocs/rt/html/NoAuth/js/*.js
 /srv/www/htdocs/rt/html/NoAuth/js/autohandler
 /srv/www/htdocs/rt/html/NoAuth/js/IE7/*.gif
 /srv/www/htdocs/rt/html/NoAuth/js/IE7/*.js
 /srv/www/htdocs/rt/html/NoAuth/js/prototype/*.js
 /srv/www/htdocs/rt/html/NoAuth/js/scriptaculous/*.js
 /srv/www/htdocs/rt/html/NoAuth/RichText
 /srv/www/htdocs/rt/html/NoAuth/rss
 /srv/www/htdocs/rt/html/Prefs/*.html
 /srv/www/htdocs/rt/html/Prefs/Elements
 /srv/www/htdocs/rt/html/REST/1.0/Forms
 /srv/www/htdocs/rt/html/REST/1.0/NoAuth
 /srv/www/htdocs/rt/html/REST/1.0/autohandler
 /srv/www/htdocs/rt/html/REST/1.0/dhandler
 /srv/www/htdocs/rt/html/REST/1.0/logout
 /srv/www/htdocs/rt/html/REST/1.0/search
 /srv/www/htdocs/rt/html/REST/1.0/ticket
 /srv/www/htdocs/rt/html/Search/*.html
 /srv/www/htdocs/rt/html/Search/*.rdf
 /srv/www/htdocs/rt/html/Search/*.tsv
 /srv/www/htdocs/rt/html/Search/Chart
 /srv/www/htdocs/rt/html/Search/Elements
 /srv/www/htdocs/rt/html/SelfService/*.html
 /srv/www/htdocs/rt/html/SelfService/Attachment
 /srv/www/htdocs/rt/html/SelfService/Elements
 /srv/www/htdocs/rt/html/Ticket/*.html
 /srv/www/htdocs/rt/html/Ticket/Attachment
 /srv/www/htdocs/rt/html/Ticket/Elements
 /srv/www/htdocs/rt/html/Ticket/Graphs/*.html
 /srv/www/htdocs/rt/html/Ticket/Graphs/dhandler
 /srv/www/htdocs/rt/html/Ticket/Graphs/Elements
 /srv/www/htdocs/rt/html/Tools/*.html
 /srv/www/htdocs/rt/html/Tools/Elements
 /srv/www/htdocs/rt/html/Tools/Reports/*.html
 /srv/www/htdocs/rt/html/Tools/Reports/Elements
 /srv/www/htdocs/rt/html/User/*.html
 /srv/www/htdocs/rt/html/User/Elements
 /srv/www/htdocs/rt/html/User/Groups/*.html
 /srv/www/htdocs/rt/html/Widgets
 %{_libdir}/perl5/vendor_perl/*/RT.pm
 %{_libdir}/perl5/vendor_perl/*/RT/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/*.pod
 %{_libdir}/perl5/vendor_perl/*/RT/Action/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Approval/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Approval/Rule/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Condition/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Crypt/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/CustomFieldValues/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Graph/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/I18N/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/I18N/*.po
 %{_libdir}/perl5/vendor_perl/*/RT/I18N/*.pot
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Email/Auth/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Email/Filter/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Web/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Web/Menu/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Web/QueryBuilder/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Interface/Web/Standalone/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Report/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Report/Tickets/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Search/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Shredder/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Shredder/Plugin/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Shredder/Plugin/Base/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/Test/*.pm
 %{_libdir}/perl5/vendor_perl/*/RT/URI/*.pm
 %{_mandir}/man1/*.1*
 
 %changelog
 * Thu Aug 12 2010 YOUR NAME HERE <YOUR@DOMAIN.HERE> - 3.8.8-1
 - Initial build for OpenSuSE.
 

With the spec file above, we can build the RPM for RT, and install it. Run the following in your non-root env:

rpmbuild -ba SPECS/rt.spec

Once the package has been built, install it:

rpm -ivh RPM/noarch/rt-3.8.8-1.noarch.rpm

At this point, you'll need to modify the RT_SiteConfig.pm to be useful for your system. Below is a copy of mine with sanitised values to keep people from harvesting my email address and trying to DOS my network:

Fig 5 - /etc/rt/RT_SiteConfig.pm


Set($rtname, 'mydomain.com');
Set($Organization, "mydomain.com");
Set($Timezone, 'US/Pacific');
Set($WebPath, "/rt");
Set($WebPort, 80);
Set($WebDomain, 'myhost.mydomain.com');
Set($WebBaseURL, 'http://' . RT->Config->Get('WebDomain') . ':' . RT->Config->Get('WebPort'));
Set($WebURL, RT->Config->Get('WebBaseURL') . RT->Config->Get('WebPath') . "/");
Set($WebImagesURL, RT->Config->Get('WebPath') . "/NoAuth/images/");
Set($WebImagesURL , $WebPath . "/images/");  # need this for below
Set($LogoURL, "http://myhost.mydomain.com/rt/html/images/Home_Logo.jpg");
Set($LogoLinkURL, 'http://www.mydomain.com/');
Set($LogoAltText, "My Organization");
Set($AutoLogoff, 60);
Set($EnableReminders, 1);
Set($LogToSyslog, 'info');
Set($LogDir, '/var/log');
Set($LogToFileNamed, "rt.log");
Set($LogToFile, 'info');
Set($NotifyActor, 1);
Set($OwnerEmail , 'me AT mydomain.com');
Set(@Plugins,qw());
1;

Obviously you'll want to edit that to suite your organisation's needs. Once done making your changes, restart Apache and try to log onto your new instance of RT. Note, we've yet to set up the MTA for full production use yet. Unless you plan on using only the Postfix MTA installed on OpenSuSE 11.3 box RT lives on, you'll want to read the later steps of how to configure the MTA for your organisation.

RT FAQ Manager

Next up is to add RTFM to the installation. Read up on RTFM from Best Practical's site to determine if you need to do this step for your organisation or not.

Since RTFM is a plugin to RT, and the infrastructure is already installed on your system, it is far easier to build the package for than RT. First, grab the spec file below, and then build and install it.

Fig 6 - rtfm.spec


%define RT_CACHEDIR             /srv/www/htdocs/rt/cache
 %define PACKAGENAME             RTFM
 %define pre                     rc1
 
 Name:           rtfm
 Version:        2.4.3
 Release:        0.rc1.1
 Summary:        RT FAQ Manager
 Group:          Applications/Internet
 License:        GPL
 URL:            http://www.bestpractical.com/rtfm
 Source0:        http://www.bestpractical.com/pub/rtfm/release/%{PACKAGENAME}-%{version}%{pre}.tar.gz
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 BuildRequires:  /usr/bin/pod2man
 BuildRequires:  /usr/sbin/apache2ctl
 Requires:       rt = 3.8.8
 Requires(postun): /bin/rm
 AutoReqProv:    0
 
 %description
 RTFM is an enterprise-grade knowledge management tool that enables an
 organization to easily capture and share its employees' knowledge and wisdom.
 
 Just as you use RT (the world's leading open-source ticketing system) to log
 tickets and resolve issues, RTFM lets you open, categorize and search for
 "articles." Like RT, RTFM lets your users contribute additional information to
 existing articles and makes sure that each article's full history is preserved
 for future inspection. RTFM makes it easy to quickly search the knowledge base
 and find critical information.
 
 RTFM speeds up your response time while lightening your workload. When
 responding to a user question, your help desks and customer care centers can
 include the text of RTFM articles with just a few clicks. Each time you field a
 new question, you can easily add your reply to RTFM's database. Never having to
 type the same reply twice means dramatically increased productivity!
 
 RTFM leverages an existing investment in RT through seamless integration. If
 you field similar requests from multiple users, you can now easily extract the
 content of a single RT ticket into an RTFM article, which can be used both as a
 "stock answer" and as reference material for other staff. RTFM turns RT
 responses into readily-available documentation to help reduce an organization's
 support burden.
 
 As you would expect from a product based on RT, RTFM is incredibly flexible.
 RTFM lets local administrators define exactly what data and metadata needs to
 be tracked across all articles, as well as for specific sets of articles. RTFM
 uses RT's built-in access-control system, allowing you to easily regulate what
 users can record and share, using the same central console they use to manage
 RT. You can grant their users just the right level of access for each category
 of article.
 
 Key Features:
 * RTFM is built on RT.
 * RTFM uses RT's authentication and authorization systems.
 * RTFM integrates seamlessly with RT.
 
 %prep
 rm -rf ${RPM_BUILD_ROOT}
 
 %setup -q -n %{PACKAGENAME}-%{version}%{pre}
 
 # Fixup the tarball shipping with broken permissions
 find . \( -name '*.pm' -o -name '*.pm.in' -o -name '*.po' -o -name '*.pod' \) \
   -exec chmod a-x {} \;
 chmod -x UPGRADING README
 find etc -type f -exec chmod a-x {} \;
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL
 %{__perl} -pi -e 's/^\tLD_RUN_PATH=[^\s]+\s*/\t/' Makefile
 make %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS"
 
 %install
 rm -rf ${RPM_BUILD_ROOT}
 make DESTDIR=%{buildroot} install
 
 %clean
 rm -rf ${RPM_BUILD_ROOT}
 
 %post
 if [ $1 -eq 1 ]; then
     echo -n "Initializing RT FAQ Manager DB changes in RT's MySQL DB.... "
     # this will fail if the DB has a root password....
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action schema ||:
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action acl ||:
     echo "DONE"
     echo -n "Deleting the HTML::Mason cache directory.... "
     /bin/rm -rf %{RT_CACHEDIR}/*
     echo "DONE"
     /sbin/service apache2 restart
 fi
 
 %postun
 if [ $1 -eq 0 ]; then
     echo -n "Deleting the HTML::Mason cache directory.... "
     /bin/rm -rf %{RT_CACHEDIR}/*
     echo "DONE"
     echo -n "Dropping the RT FAQ Manager DB changes in RT's MySQL DB.... "
     # this will fail if the DB has a root password.....
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action schema ||:
     /srv/www/htdocs/rt/bin/rt-setup-database --dba root --action acl ||:
     echo "DONE"
     /sbin/service apache2 restart
 fi
 
 %files
 %defattr(-,root,root,-)
 %doc Changelog MANIFEST META.yml README UPGRADING TODO UPGRADING.mysql
 /srv/www/htdocs/rt/local/man/auto/RTFM
 /srv/www/htdocs/rt/local/man/man3/*.3pm
 /srv/www/htdocs/rt/local/plugins/RT-FM/lib/*.pod
 /srv/www/htdocs/rt/local/plugins/RT-FM/lib/RT/*.pm
 /srv/www/htdocs/rt/local/plugins/RT-FM/lib/RT/FM/*.pm
 /srv/www/htdocs/rt/local/plugins/RT-FM/lib/RT/FM/*.pod
 /srv/www/htdocs/rt/local/plugins/RT-FM/lib/RT/URI/*.pm
 
 %changelog
 * Sat Aug 14 2010 YOUR NAME HERE <YOUR@DOMAIN.HERE> - 2.4.3-0.rc1.1
 - Initial build for OpenSuSE.
 

Now that you've built RTFM, install it. You now need to modify your RT_SiteConfig.pm to add RT::FM to the @plugin array to activate it. Once added, restart Apache again, and now you'll see RTFM's entry in the side bar, allowing you to start adding entries to it for canned responses and other useful bits.

RT::Authen::ExternalAuth

While many people will be fine with using RT's built in authentication system against the MySQL database, many companies these days use OpenLDAP or Microsoft's Active Directory to centrally authenticate users. Natively, RT has no knowledge of these systems, which means we'll need the RT::Authen::ExternalAuth extension to enable RT's authentication against an external DB or LDAP. In my organisation's case (for better or worse), we're using Microsoft's Active Directory, so we'll be showing how to work with that instead of normal OpenLDAP. (Patches to this guide are welcome for those that want to explore other LDAP flavours.)

First, download the tarball for RT::Authen::ExternalAuth to the RPM SOURCES directory. Like RTFM, RT::Authen::ExternalAuth is an extension, so building it will be a piece of cake compared to RT. Note however, there are some essential required packages that must be installed to allow it to work.