[rt-users] Step-by-Step instructions: FreeBSD4.8 RT3.0.5 (upgraded to 3.0.6), apache13-modssl, mod_perl, mysql, RTFM, Statistics

Mike Patterson mikep at uclink.berkeley.edu
Sat Oct 4 01:19:22 EDT 2003


This is how I installed RT.  It may not be the easiest to install/best 
configuration, but it works for me. 
I found the RedHat 7.2 step-by-step instructions for the RT2 series a 
lifesaver when I was first starting.
http://fsck.com/rtfm/article.html?id=2#180

I would have liked to include step-by-step LDAP Active Directory 
external authentication for RT.
However I haven't figured it out yet and have only seen reference to it 
being able to work, not quite enough concrete docs or at least conf file 
snippets.

1) First I installed FreeBSD 4.8 from CD choosing the "Minimal install" 
option with "linux compatibility". 
(Why install stuff that you don't need/might be vulnerable)

Here's some tips on FreeBSD ports basics:
http://www.onlamp.com/pub/a/bsd/2003/08/28/FreeBSD_Basics.html

2) Get a couple basic ports installed, then update all of the ports 
before doing any other installation.
I installed lynx, portupgrade, and /usr/ports/net/cvsup-without-gui
% cd /usr/ports/www/lynx ; make ; make install
% cd /usr/ports/net/cvsup-without-gui ; make ; make install

3) created /root/ports-supfile from template
% cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
I changed 2 things on this file.  You could of course choose a different 
cvsup host.

%diff /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
51c51
< *default host=CHANGE_THIS.FreeBSD.org
---
 > *default host=cvsup10.FreeBSD.org
58c58
< *default compress
---
 > #*default compress

3) Run this to update ports (take a coffee break after starting)
% cvsup -g -L 2 /root/ports-supfile

4) Run this update ports index (Lunchtime!)
% portsdb -Uu
# The command below updates all installed ports and dependencies.  This 
could be dangerous later down the line.
% portupgrade -arR

--FREEBSD Port Tricks--
: to tell if any of the installed ports need upgrading run this:
% portversion -l "<"
Trick to list dependencies:
% cd /usr/ports/www/rt3
% make pretty-print-build-depends-list

Searching for a ports
by keyword:
% cd /usr/ports
% make search key=dvd | more
by name:
% make search name=netscape | more

update port listing (takes awhile to run)
% make index

display info on installed packages
% pkg_info -ac
more detail info
pkg_info -a

show postinstall messages (in case there is postconfig):
% pkg_info -xD lynx
show file locations:
% pkg_info -xL lynx | more

To check if port is a dependency from another port:
% pkg_info -R lynx-2.8.4.1d
--END FREEBSD Port Tricks0--

6) Now update Perl to 5.8 (thanks RT community for telling me how to do 
this)
cd /usr/ports/lang/perl5.8 ; make clean ; make install
#command below tells perl to use the 5.8 perl instead of the 5.00x 
system installed perl
% use.perl port
#below tells me what I'm using
% perl -v
# if you dedide to go back to using the original perl run this
### "use.perl system"

6) Get MCPAN up and going.  First get the CPAN dependencies
INSTALLED for MCPAN build
% pwd
cd /usr/ports/archivers/unzip ; make ; make install
cd /usr/ports/ftp/wget ; make ; make install
cd /usr/ports/ftp/ncftp3 ; make ; make install

#Now install CPAN
# ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY has lists of good CPAN sites
% perl -MCPAN -e shell
% install Bundle::CPAN

7) install mysql
install mysql server
% cd /usr/ports/databases/mysql40-server ; make WITH_OPENSSL=yes; make 
install
% /usr/local/bin/mysqld_safe &
% /usr/local/bin/mysqladmin -u root password 'mypasswenthere'
% /usr/local/bin/mysql -p to check password

8) install Apache with SSL (you may not want SSL)
#now install apache
% /usr/ports/www/apache13-modssl ; make ; make install
# note this is startup script /usr/local/etc/rc.d/apache.sh-dist

9) install mod_perl, tell it to use modssl build
cd /usr/ports/www/mod_perl
#changed to this on mod_perl Makefile
APACHE_PORT?=  ${PORTSDIR}/www/apache13-modssl
cd /usr/ports/www/mod_perl ; make clean install && make clean
cd /usr/ports/www/apache13-modssl ; make reinstall
##got error so...
cd /usr/ports/www/apache13-modssl ; make deinstall ; make reinstall

10) Rather than going with the RT port (which at the time was 3.04, I 
downloaded the newest RT at the time 3.0.5 (into /usr/local/src), it 
could be argued that it would be easier to just use the RT port.  
Shortly after my install I noticed the RT port was updated to 3.0.5)
test RT dependencies:
% perl /usr/local/src/rt-3-0-5/sbin/rt-test-dependencies --with-mysql

#install RT prereqs
#install prereqs for HTML mason
% perl -MCPAN -e shell
cpan> install Params::Validate
cpan> install Exception::Class
cpan> install Class::Container
cpan> install Scalar::Util
cpan> install Cache::Cache
cpan> install MLDBM
cpan> install FreezeThaw
cpan> install Apache::Session
cpan> install HTML::Mason

#MAILGATE dependencies
cpan> install HTML::TreeBuilder
cpan> install HTML::FormatText
cpan> install LWP::UserAgent

#CORE dependencies
cpan> install Test::Inline
cpan> install Class::ReturnValue
cpan> install DBIx::SearchBuilder
cpan> install Text::Template
cpan> install Log::Dispatch
cpan> install Locale::Maketext
cpan> install Locale::Maketext::Lexicon
cpan> install Locale::Maketext::Fuzzy
cpan> install MIME::Entity
cpan> install Text::Wrapper
cpan> install Time::ParseDate
cpan> install Text::Autoformat
cpan> install Text::Quoted

DEV dependencies:
###Note I couldn't get this right from CPAN so I ended up installing 
from port instead.
###You can probably skip straight to port install.
cpan> install WWW::Mechanize
make test had returned bad status, won't install without force
possible unmet dependecies for test...
    cpan> install Test::Pod
    cpan> install Test::Warn
still failed installed using cpan, so did from port below

% cd /usr/ports/www/p5-WWW-Mechanize ; make clean ; make install

#all dependencies met :-)

11) Create user rt3 in the rt3 group (look at this if you need user 
creation tips):
http://www.onlamp.com/pub/a/bsd/2001/01/03/FreeBSD_Basics.html

12) now install rt3 (I like it in /usr/local/ better than the default 
/opt but suit yourself)
% ./configure --with-mysql --prefix=/usr/local/rt3 --with-web-user=www 
--with-web-group=www --with-db-rt-user=rt3 --with-rt-group=rt3 
--with-db-rt-pass=mypasswordwent here
% make install

13)Edit your SiteConfig
% vi /usr/local/rt3/etc/RT_SiteConfig.pm
---mine looks like this:-----------------------------------------------
--- change myserver, myrtname, myemail substitute to match your setup--
---I prefer using an Alias of /rt3 rather than a virtualhost-----------
---I like using https instead of http----------------------------------
1;
$Timezone='US/Pacific';
$CorrespondAdddress='rt at myserver.mycompany.com';
$WebBaseURL='https://myserver.mycompany.com';
$WebPath='/rt3';
Set($rtname , "myrtname");
Set($Organization , "myserver.mycompany.com");
Set($OwnerEmail , 'myemail at mycompany.com');
Set($CorrespondAddress , 'rt at myserver.mycompany.com');
Set($CommentAddress , 'rt at myserver.mycompany.com');
-----------------------------------------------------------------------

14)Add tables to mysql
% make initialize-database

13) Add httpd.conf directives
% vi /usr/local/etc/apache/httpd.conf
#Note: I'm not sure whether or not I needed theNoAuth alias
##################RT#############################
Alias /rt3/rt3/NoAuth/images/  /usr/local/rt3/share/html/NoAuth/images
Alias /rt3 /usr/local/rt3/share/html/
PerlRequire /usr/local/rt3/bin/webmux.pl
<Location /rt3>
  SetHandler perl-script
  PerlHandler RT::Mason
  PerlModule Apache::DBI
</Location>
<Directory "/usr/local/rt3/share/html">
    Options FollowSymLinks
    AllowOverride All
</Directory>
###############END RT#############################


14) Apache not Quite working yet, what I did to fix DBI error message.
#Both of these attempts to start apached failed (note it did work before 
adding httpd.conf directives in step 13)
% /usr/local/sbin/apachectl startssl
% /usr/local/sbin/apachectl start
Syntax error on line 1333 of /usr/local/etc/apache/httpd.conf:
Can't locate Apache/DBI.pm in @INC (@INC contains: 
/usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd 
/usr/local/lib/perl5/site_perl/5.8.0/mach 
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl 
/usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach 
/usr/local/lib/perl5/5.8.0 . /usr/local/ /usr/local/lib/perl) at (eval 
6) line 3.

/usr/local/sbin/apachectl start: httpd could not be started

#try to fix DBI
% cd /usr/ports/databases/p5-DBI ; make clean ; make install
#nope, try again
% cd /usr/ports/databases/p5-DBI ; make deinstall ; make reinstall
#no dice trying this
%perl -MCPAN -e shell
cpan> install Apache::DBI

% /usr/local/sbin/apachectl startssl
#Web Interface is up :-)
# Note: For me sendmail, mysql, and apache were already running, but 
sometimes I forget this when testing or just after a reboot.  This is a 
good thing to doublecheck.

15)
#Logged into web interface using defaults
#User= "root"
#Password = "password"
#Changed root Password to something else
#gave "everyone" create and reply permission in general queue (so 
sending an email will create ticket).

16)
Add lines below to /etc/aliases - run newaliases to make changes in 
alias file take effect.
#so mail to rt at myserver.mycomany.com goes into general queue, 
rt-comment at mysever adds comment to existing ticket
#----
rt: "|/usr/local/rt3/bin/rt-mailgate --queue general --action correspond 
--url http://myserver.mycompany.com/rt3/"
rt-comment: "|/usr/local/rt3/bin/rt-mailgate --queue general --action 
comment --url http://myserver.mycompany.com/rt3/"
#----
% newaliases

17) So now that RT is running I want to Add On to it:

#downloaded and unzipped RTFM 2.0.0 from http://fsck.com/pub/rt/release/ 
to /usr/local/src
changed RT prefix in Makefile since I installed in /usr/local/ instead 
of /opt
#RT_PREFIX              = /opt/rt3
RT_PREFIX              = /usr/local/rt3
% cd /usr/local/src/rtfm-2-0-0 ; make install
# restart Apache to test interface, it works :-)
%/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

18) I just noticed a new RT release that has bug fixes for RTFM, decide 
to upgrade.
#download and unzip src
cd /usr/local/src/rt-3-0-6
% ./configure --with-mysql --prefix=/usr/local/rt3 --with-web-user=www 
--with-web-group=www --with-db-rt-user=rt3 --with-rt-group=rt3 
--with-db-rt-pass=mypasswordwenthere
$ make upgrade
% ls etc/upgrade
# "2.1.71" was listed
% /usr/local/rt3/sbin/rt-setup-database --action insert --datafile 
etc/upgrade/2.1.71
% /usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

19) I decided to install Statistics Package
#statistics package
#meet prereqs (libgd and GD::Graph)
% make search name=gd    #this is how I searched for correct ports
% cd /usr/ports/graphics/gd ; make ; make install
% cd /usr/ports/graphics/p5-GD-Graph3d ; make ; make install
# download stats package http://www.fsck.com/pub/rt/contrib/3.0/
# I gunzipped and untared and then moved folders to correct location 
(for me).
% mv Statistics /usr/local/rt3/local/html
% mv Elements /usr/local/rt3/local/html
#stats are generally working, but not the graph (I believe this worked 
in 3.0.5, the author is working on a fix).

20) I noticed that I had 2 copies of every scrip, removed 2nd copy
(This has happend to me before, I'm not sure if it's me or RT)
 From WebRT choose Configruation:Global:Scrips
   
On Correspond Open Tickets with template Blank   
On Create Autoreply To Requestors with template Autoreply   
On Create Notify AdminCcs with template Transaction   
On Correspond Notify AdminCcs with template Admin Correspondence   
On Correspond Notify Requestors and Ccs with template Correspondence   
On Correspond Notify Other Recipients with template Correspondence   
On Comment Notify AdminCcs as Comment with template Admin Comment   
On Comment Notify Other Recipients as Comment with template 
Correspondence   
On Resolve Notify Requestors with template Resolved

21) I decided to sign my own SSL certificate, instead of using the 
default "snakeoil" one or purchasing one.
I followed instructions here to make a self-signed certificate
http://www.thawte.com/html/SUPPORT/server/softwaredocs/modssl.html

% openssl genrsa -out myserver.mycompany.com.key 1024
% openssl req -new -key myserver.mycompany.com.key -out 
myserver.mycompany.com.csr
% openssl x509 -req -days 10000 -in myserver.mycompany.com.csr -signkey 
myserver.mycompany.com.key -out myserver.mycompany.com.crt

#Gave path to newly generated certificates in httpd.conf
#SSLCertificateFile /usr/local/etc/apache/ssl.crt/server.crt
SSLCertificateFile /usr/local/etc/apache/ssl.crt/myserver.mycompany.com.crt
#SSLCertificateKeyFile /usr/local/etc/apache/ssl.key/server.key
SSLCertificateKeyFile 
/usr/local/etc/apache/ssl.key/myserver.mycompany.com.key

#restarted apache
/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

22) I wanted PHP too, although you don't need this for RT
INSTALL PHP
% cd /usr/ports/www/mod_php4 ; make ; make install
(added in addition to defaults: mcrypt, mhash, openldap2, openssl, 
postgresql by checking the box when prompted)

#I added these lines to httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

#restarted apache
/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

---------
I hope that was useful I appreciate all the help I've gotten from the RT 
community.
---------




More information about the rt-users mailing list