You're not currently signed in. Sign in.

Red Hat Enterprise Linux 4 Update2 + RT 3.6.3 + FastCGI 2.4.2 Install Guide

(based on procedure posted by William Harrison to rt-users@lists.bestpractical.com)

-- General note: All commands should be carried out as the root user unless otherwise stated.

1) Perform a standard install of RHEL, then upgrade / up2date / whatever to get latest versions of installed packages. Verify you have the following packages to satisfy the installation requirements of mod_fastcgi. If you do not you may receive the following error:

Subscribing to the RHEL AS (v. 4 for x86) Fastrack, Red Hat Web Application Stack 1.0 Beta (for AS v. 4 x86), and RHEL AS (v. 4 for x86) Extras channels solves many dependencies off the bat. It also keeps most your libraries patched via up2date.

make: *** No rule to make target `/etc/httpd/build/special.mk'.  Stop.]

httpd-devel
apr-devel
mysql
mysqlclient10
mysql-server
mysql-devel
gcc
sendmail-cf

### The following packages resolve some CPAN module dependencies (specifically, the GD module):
### Note: RHEL ships with mod_perl 1.99 and is not compatible with RT (we will instead use FastCGI), but mod_perl is required to
### satisfy certain perl module dependencies.

mod_perl
freetype-devel
gd-devel
libjpeg-devel
libpng-devel
xorg-x11-devel

### I found the CPAN steps below went a little more smoothly with
### all perl packages installed (yes, it's overkill).

perl-*


1a) See Step 6 First: /opt/rt3/bin/mason_handler.fcgi does not exist yet

2) Install FastCGI... (required, since RT only works with mod_perl2, not mod_perl 1.99 that RHEL4 ships with)

Note: mod_perl 2.x is available from the Red Hat Web Application Stack 1.0 Beta (for AS v. 4 x86) channel. You can subscribe your system(s) to it through RHN's interface.

wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
tar -zxvf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
cp Makefile.AP2 Makefile
vi Makefile

### Modify Makefile for location of apache 2 installation:
  top_dir      = /etc/httpd

make
make install

### Create file FastCGI.conf
  touch /etc/httpd/conf.d/FastCGI.conf
  vi /etc/httpd/conf.d/FastCGI.conf

###Add the following lines to load FastCGI module.(FastCGI.conf):
  LoadModule fastcgi_module modules/mod_fastcgi.so
  FastCgiIpcDir /tmp
  FastCgiServer /opt/rt3/bin/mason_handler.fcgi -idle-timeout 120 -processes 8
  FastCgiConfig -restart

### FastCGI wants to have a place to put its logs, and permission to do so:
  mkdir -p /etc/httpd/logs/fastcgi/dynamic
  chown -R apache:apache /etc/httpd/logs/fastcgi
  service httpd restart

### Check Apache logs to make sure fastcgi started
### Should see one line indicating a [notice] and the pid of FastCGI
### [Mon Mar 14 9:16:57 2005] [notice] FastCGI: process manager initialized (pid 3478)
  tail -n 50 /var/log/httpd/error_log


3) Turn on MySQL server, Apache server, and optionally set MySQL root password.

chkconfig httpd on
chkconfig mysql on
service mysql start
mysqladmin -u root password newpass

3.5) Install ncftpget

### Note the path for ncftpget "./ncftp-3.2.0/bin/ncftpget", which will be needed next.
wget -c ftp://ftp.ncftp.com/ncftp/binaries/ncftp-3.2.0-linux-x86-glibc2.3-export.tar.gz
tar -xvzf ncftp-3.2.0-linux-x86-glibc2.3-export.tar.gz

cd ncftp-3.2.0
make
make install


4) RT Pre-Install : Security

Note: This requires a reboot, or a more extensive bouncing of various daemons. 
The easiest thing to do is make the following change, and then reboot.
For more info on switching selinux policy, please see http://fedora.redhat.com/docs/selinux-faq-fc3/index.html#id2825232
### RT requires its own group, so let's add it now lest we forget:
  groupadd rt

### RT gets initiated by apache, so add apache to the rt group:
  vi /etc/group
  ### Change the line:
  ### rt:x:501:
  ### to read:
  ### rt:x:501:apache

### Disable selinux (or make sure it is disabled):
   vi /etc/selinux/config
   ### Change the line:
   ### SELINUX=enforcing
   ### or
   ### SELINUX=permissive
   ### to read:
   ### SELINUX=disabled

### Change permissions on /etc/httpd/logs
   chmod -Rf 755 /etc/httpd/logs

5) RT Pre-Install : Perl Modules

###Download and install the following modules:
### http://dag.wieers.com/rpm/packages.php

perl-Apache-Session-1.80-1.2.el4.rf.noarch.rpm
perl-Class-Container-0.12-1.2.el4.rf.noarch.rpm
perl-Class-Data-Inheritable-0.04-1.2.el4.rf.noarch.rpm
perl-Crypt-DES-2.03-3.2.el4.rf.i386.rpm
perl-Devel-StackTrace-1.12-1.2.el4.rf.noarch.rpm
perl-Exception-Class-1.22-1.2.el4.rf.noarch.rpm
perl-GD-2.30-2.2.el4.rf.i386.rpm
perl-GD-Graph-1.43-1.2.el4.rf.noarch.rpm
perl-GD-Text-Util-0.86-1.2.el4.rf.noarch.rpm
perl-Hook-LexWrap-0.20-1.el4.rf.noarch.rpm
perl-HTML-Mason-1.32-1.2.el4.rf.noarch.rpm
perl-HTTP-Server-Simple-0.16-1.2.el4.rf.noarch.rpm
perl-HTTP-Server-Simple-Mason-0.09-1.el4.rf.noarch.rpm
perl-IO-Socket-INET6-2.51-1.2.el4.rf.noarch.rpm
perl-Net-SNMP-5.0.1-1.2.el4.rf.noarch.rpm
perl-Params-Validate-0.78-1.2.el4.rf.i386.rpm
perl-Socket6-0.18-1.2.el4.rf.i386.rpm

###Set up CPAN initially, walk through its setup (if you have not already done so), and upgrade CPAN.
 perl -MCPAN -e shell

### From within CPAN..
 install Bundle::CPAN

6) Configure RT...

wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz
gunzip rt.tar.gz
tar -xvf rt.tar
cd rt-3.6.3/

### Set up the makefile for us with the proper settings:
  ./configure --with-web-user=apache --with-web-group=apache --with-fastcgi --with-mysql

### MIME::Entity won't install without MIME::Base64, so install that first:
  perl -MCPAN -e 'install MIME::Base64'

### Now install IO:File (required for passing tests during MIM::Entity build):
  perl -MCPAN -e 'install IO::File'

### Now install MIME::Entity:
  perl -MCPAN -e 'install MIME::Entity'

### Now install Log::Dispatch:
  perl -MCPAN -e 'install Log::Dispatch'

### Module::Build can have problems with argument length, use this older version to fix it: 
### http://www.city-fan.org/ftp/contrib/perl-modules/RPMS.rhel4/perl-Module-Build-0.2612-1.rhel4.noarch.rpm
### See here for more details: http://www.mail-archive.com/fedora-perl-devel-list@redhat.com/msg01000.html

### If you plan on making the request tracker install use ssl (as in https) then you will also need to install Crypt::SSLeay
  perl -MCPAN -e 'install Crypt::SSLeay'

### Finally Install the RT Bundle
  perl -MCPAN -e 'install Bundle::RT'

### Show us what else is missing:
  perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --verbose | grep MISSING

### Try to install what's missing for us through CPAN automatically. If automatic install fails then 
### install whatever is missing manually via CPAN.
  perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --install

### Test again and make sure nothing is MISSING:
  perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --verbose | grep MISSING

### Assuming everything is present and it's a go, install...
  make install

7) Edit RT config file

vi /opt/rt3/etc/RT_SiteConfig.pm

### configure RT web paths:
  Set($WebBaseURL , "http://your.host.name:80");
  Set($WebPath , "");
  Set($rtname, "mysite.com");

### Change $DatabasePassword to something other than the default "rt_pass"
### you don't need to create this user yourself RT will create it while next step
  # Set($DatabaseUser , "rt_user"); # Only uncomment if you change from the default "rt_user";
  Set($DatabasePassword , "secrete_password_rt_uses_to_connect_db");

8) Initialize the database:

### Initialize the database:
  make initialize-database


9) Edit your Apache config file as well:

edit /etc/httpd/conf/httpd.conf
###  NameVirtualHost *:80
###  <VirtualHost *:80>
###    ServerAdmin root
###    ServerName your.host.name
###    DocumentRoot /opt/rt3/share/html/
###    AddDefaultCharset UTF-8
###    # Adding the following for RT (the ticket tracker)
###    AddHandler fastcgi-script .fcgi
###    <Directory "/opt/rt3/share/html">
###      Options FollowSymLinks ExecCGI
###      AllowOverride None
###    </Directory>
###    # Pass through requests to for noauth
###    Alias /NoAuth/images /opt/rt3/share/html/NoAuth/images
###    ScriptAlias / /opt/rt3/bin/mason_handler.fcgi/
###  </VirtualHost>
###  FastCgiIpcDir /tmp
###  FastCgiServer /opt/rt3/bin/mason_handler.fcgi -idle-timeout 120 -processes 4

10) Restart Apache:

service httpd restart

Check /var/log/httpd/error_log for any errors.  If you see a line similar to
### Can't locate FCGI.pm in @INC (@INC contains: ...

perl -MCPAN -e 'install FCGI'
service httpd restart

Confirm above error message is not present and there are no other errors.


11) Attempt to log into RT at http://your.host.name/ <- don't forget the trailing / to point to the rt subdirectory, otherwise this will not work

default user = root
default pass = password
##Be sure to change these before using thing in a production environment##

12) Symlink rt-mailgate to /etc/smrsh, and create aliases to use RT:

ln -s /opt/rt3/bin/rt-mailgate /etc/smrsh/rt-mailgate
edit  /etc/aliases:
   ### Add lines:
   ### rt: "|/etc/smrsh/rt-mailgate --queue general --action correspond --url http://your.host.name/"
   ### rt-comment: "|/etc/smrsh/rt-mailgate --queue general --action comment --url http://your.host.name/"

13) Configure Sendmail:

edit /etc/mail/sendmail.mc:
   ### Change the line:
   ### DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
   ### to read:
   ### dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
rebuild your sendmail.cf:
   m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
add rt server alias to /etc/mail/local-host-names:
   ### Add line:
   ### rt.example.com
restart sendmail:
   service sendmail restart

14) Use the RT Web interface:

set up users
grant user rights
create queues
lather, rinse repeat...

15) Look at ItsFinallyInstalledNowWhat for hints on setting up RT to accept E-mail ticket requests