FUNCTIONING: RT on RHEL 4 with FastCGI and MySQL Install Procedure

Well, thanks to hard work and effort from others, this procedure has been verified to work across at least three installations of RHEL 4. If you think it would be of value, I’m happy to add it to the wiki.

Installation procedure follows…

-William

Installing RT on RHEL 4 with FastCGI and MySQL:

Start with a standard install of RHEL, then upgrade / up2date / whatever to get latest versions of installed packages. Then make sure you have the following packages as well:
httpd-devel
mysql
mysqlclient10
mysql-server
mysql-devel
gcc

Install FastCGI…
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
gunzip mod_fastcgi-2.4.2.tar.gz
tar -xvf mod_fastcgi-2.4.2.tar
cd mod_fastcgi-2.4.2
cp Makefile.AP2 Makefile
edit Makefile:
###Modify for location of apache 2 installation:
top_dir = /etc/httpd
make
make install
edit /etc/httpd/conf/httpd.conf
###Add line to load FastCGI module:
LoadModule fastcgi_module modules/mod_fastcgi.so

FastCGI wants to have a place to put its logs, and permission to do so:

mkdir /etc/httpd/logs/fastcgi
mkdir /etc/httpd/logs/fastcgi/dynamic
chown apache:apache /etc/httpd/logs/fastcgi
chown apache:apache /etc/httpd/logs/fastcgi/dynamic

service httpd start

Check Apache logs to make sure fastcgi started

less /var/log/httpd/error_log
### Should see no lines with [error] referencing FastCGI
### 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)

Turn on MySQL server, Apache server, set MySQL root password…
chkconfig httpd on
chkconfig mysqld on
service mysqld start
mysqladmin -u root password newpass

Set up CPAN initially…
perl -MCPAN -e shell

RT Pre-Install…

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:

edit /etc/group
### Change the line:
### rt:x:501:
### to read:
### rt:x:501:apache

Disable selinux (or make sure it is disabled):

 edit /etc/selinux/config
 ### Change the line:
 ### SELINUX=enforcing
 ### or
 ### SELINUX=permissive
 ### to read:
 ### SELINUX=disabled

Change permissions on /etc/httpd/logs from within

 cd /etc/htttpd/logs
 chmod 755 .

Install RT…
wget http://download.bestpractical.com/pub/rt/release/rt-3.4.1.tar.gz
gunzip rt.tar.gz
tar -xvf rt.tar
cd rt-3.4.1/

Set up the makefile for us with the proper settings:

./configure --with-web-user=apache --with-web-group=apache --with-mysql --with-fastcgi

Show us what’s missing and what’s not:

perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --verbose

Try to install what’s missing for us through CPAN:

perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --install

Test again and only show us the MISSING items this time:

perl sbin/rt-test-dependencies --with-mysql --with-fastcgi --verbose | grep MISSING

MIME::Entity won’t install without MIME::Base64, so install that first:

perl -MCPAN -e 'install MIME::Base64'

Now install MIME::Entity:

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

Try to install anything else missing for us:

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 and intialize database…

make install
make initialize-database

Make a copy of the dist config file to edit:

cp /opt/rt3/etc/RT_Config.pm /opt/rt3/etc/RT_SiteConfig.pm

Edit your RT config file for your purposes:

edit /opt/rt3/etc/RT_SiteConfig.pm
### Change the line:
### Set($WebBaseURL , "http://RT::WebBaseURL.not.configured:80");
### to read:
### Set($WebBaseURL , "http://your.ip.address:80");
### Change the line:
### Set($WebPath , "");
### to read:
### Set($WebPath , "/rt");

Edit your Apache config file as well:

edit /etc/httpd/conf/httpd.conf
###  NameVirtualHost *:80
###  <VirtualHost *:80>
###    ServerAdmin root
###    DocumentRoot /var/www/html/
###    # 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 display images
###    Alias /NoAuth/images/ /opt/rt3/share/html/NoAuth/images/
###  </VirtualHost>
###  FastCgiServer /opt/rt3/bin/mason_handler.fcgi -idle-timeout 120
###  ScriptAlias /rt /opt/rt3/bin/mason_handler.fcgi

###Restart Apache:
service httpd stop
service httpd start

Looks good to me. My only suggestion is to add some information about the
“-processes (# here)” option for the FastCgiServer line. Only having one
Mason process start up makes trouble shooting much easier, but from what I
understand it could lead to slowing if multiple folks are accessing the
site since they would have to wait for the mason process to finish with
other requests.

I am sticking with one right now, but that is because I am running on a
PII 333 with 150MB ram and it just can’t take more of a memory footprint
being used. I tried more last night and I think it slowed things down
rather than sped things up!

So, this value is definitely tunable according to your server specs and RT
load.

I’m very glad you got things working,
Sam

William Harrison said:

Well, thanks to hard work and effort from others, this procedure has been
verified to work across at least three installations of RHEL 4. If you
think it would be of value, I’m happy to add it to the wiki.

Installation procedure follows…

-William

I am sticking with one right now, but that is because I am running on a
PII 333 with 150MB ram and it just can’t take more of a memory footprint
being used. I tried more last night and I think it slowed things down
rather than sped things up!

Buy RAM, Sam. :slight_smile:

Cheers,
– jr “it’s cheap” a
Jay R. Ashworth jra@baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274

  If you can read this... thank a system adminstrator.  Or two.  --me

Jay R. Ashworth said:> On Fri, Mar 18, 2005 at 04:05:37PM -0700, Sam Snow wrote:

I am sticking with one right now, but that is because I am running on a
PII 333 with 150MB ram and it just can’t take more of a memory footprint
being used. I tried more last night and I think it slowed things down
rather than sped things up!

Buy RAM, Sam. :slight_smile:

Cheers,
– jr “it’s cheap” a

I could, but I would also have to buy a new server since this one (an
older HP) can’t take any more than 150 MB. It is already maxed out.

:frowning:

Sam

Jay R. Ashworth said:

I am sticking with one right now, but that is because I am running on a
PII 333 with 150MB ram and it just can’t take more of a memory footprint
being used. I tried more last night and I think it slowed things down
rather than sped things up!

Buy RAM, Sam. :slight_smile:

Cheers,
– jr “it’s cheap” a

I could, but I would also have to buy a new server since this one (an
older HP) can’t take any more than 150 MB. It is already maxed out.

My most convenient vendor has a Sempron 2200 with 128/40 for $284; $50
for an extra 256MB.

:-}

Ok, yeah, that’s not a server, but these things are relative.

Cheers,
– jr ‘and yes, I’ve read Limoncelli and Hogan’ a
Jay R. Ashworth jra@baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274

  If you can read this... thank a system adminstrator.  Or two.  --me