RT on RHEL 4 with FastCGI Install Procedure

Here’s what I’ve done so far to install RT on RHEL 4 with the included Apache2 package and FastCGI.

I’m still getting errors (Apache will not restart once it has been configured). Any help would be greatly appreciated. INstall procedure and notes below.

[error] Can’t load ‘/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so’ for module MIME::Base64: /usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so: failed to map segment from shared object: Permission denied at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.\n at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Head.pm line 123.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Head.pm line 123.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Entity.pm line 235.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Entity.pm line 235.\nCompilation failed in require at /opt/rt3/lib/RT/I18N.pm line 66.\nBEGIN failed–compilation aborted at /opt/rt3/lib/RT/I18N.pm line 66.\nCompilation failed in require at /opt/rt3/lib/RT.pm line 48.\nBEGIN failed–compilation aborted at /opt/rt3/lib/RT.pm line 48.\nCompilation failed in require at /opt/rt3/bin/webmux.pl line 64.\nBEGIN failed–compilation aborted at /opt/rt3/bin/webmux.pl line 64.\nCompilation failed in require at (eval 2) line 1.\n
[error] Can’t load Perl file: /opt/rt3/bin/webmux.pl for server rt.nitrd.gov:0, exiting…

I believe it is tied to installing Apache::DBI, but it fails each and every time via CPAN… suggestions?

INSTALL PROCEDURE:

Fresh install of RHEL 4, then upgrade / up2date / whatever to get latest versions. For me, that looks like:
httpd-2.0.52-9
httpd-devel-2.0.52-9
mysql-4.1.7-4
mysqlclient10-3.23.58-4
mysql-server-4.1.7-4
mysql-devel-4.1.7-4
libdbi-dbd-mysql-0.6.5-10

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

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

RT requires its own group, so let’s add it now lest we forget:

groupadd rt

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");

Edit your Apache config file as well:

edit /etc/httpd/conf/httpd.conf

  <VirtualHost your.ip.address>
     ServerName rt.example.com
     DocumentRoot /opt/rt3/share/html
     AddDefaultCharset UTF-8
     PerlModule Apache2 Apache::compat
     PerlModule Apache::DBI
     PerlRequire /opt/rt3/bin/webmux.pl
     <Location />
         SetHandler perl-script
         PerlHandler RT::Mason
     </Location>
     RedirectMatch permanent (.*)/$ http://128.150.142.104$1/index.html
  </VirtualHost>

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

Apache will not start, yeilidng the following errors:

[error] Can’t load ‘/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so’ for module MIME::Base64: /usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so: failed to map segment from shared object: Permission denied at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.\n at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Words.pm line 85.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Head.pm line 123.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Head.pm line 123.\nCompilation failed in require at /usr/lib/perl5/site_perl/5.8.5/MIME/Entity.pm line 235.\nBEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.5/MIME/Entity.pm line 235.\nCompilation failed in require at /opt/rt3/lib/RT/I18N.pm line 66.\nBEGIN failed–compilation aborted at /opt/rt3/lib/RT/I18N.pm line 66.\nCompilation failed in require at /opt/rt3/lib/RT.pm line 48.\nBEGIN failed–compilation aborted at /opt/rt3/lib/RT.pm line 48.\nCompilation failed in require at /opt/rt3/bin/webmux.pl line 64.\nBEGIN failed–compilation aborted at /opt/rt3/bin/webmux.pl line 64.\nCompilation failed in require at (eval 2) line 1.\n
[error] Can’t load Perl file: /opt/rt3/bin/webmux.pl for server rt.nitrd.gov:0, exiting…

Commenting out the PerlRequire /opt/rt3/bin/webmux.pl yeilds a different error:

[error] Can’t locate Apache/DBI.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . /etc/httpd/ /etc/httpd/lib/perl) at (eval 2) line 3.\n

William Harrison said:

Here’s what I’ve done so far to install RT on RHEL 4 with the included
Apache2 package and FastCGI.

I’m still getting errors (Apache will not restart once it has been
configured). Any help would be greatly appreciated. INstall procedure and
notes below.

Edit your Apache config file as well:

edit /etc/httpd/conf/httpd.conf

  <VirtualHost your.ip.address>
     ServerName rt.example.com
     DocumentRoot /opt/rt3/share/html
     AddDefaultCharset UTF-8
     PerlModule Apache2 Apache::compat
     PerlModule Apache::DBI
     PerlRequire /opt/rt3/bin/webmux.pl
     <Location />
         SetHandler perl-script
         PerlHandler RT::Mason
     </Location>
     RedirectMatch permanent (.*)/$

http://128.150.142.104$1/index.html

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

Are you planning on using FastCgi? Your apache config is for a mod_perl
based install, not a fastcgi based one.

I posted what worked for me fastcgi+apache2 a few days ago. I will forward
it to you directly.

Sam

[error] Can’t load
‘/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so’

failed to map segment from shared object: Permission denied at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.\n

What is the permission of
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so
or of its parent directories? Does Apache have access?

Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
“Of making many books there is no end, and much study is a
weariness of the flesh.” - Eccl. 12:12b

What is the permission of
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so
or of its parent directories? Does Apache have access?

-r-xr-xr-x 1 root root 47308 Mar 15 11:22 /usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64/Base64.so

drwxr-xr-x 2 root root 4096 Mar 15 11:22 /usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/MIME/Base64

So it looks like Apache does have permission to execute it…

Hi,

I’m also struggling with the apache/mod_perl set-up, and was wondering
whether to change to fastcgi myself. Would it be possible to get a
forward as well or maybe you could post it to the list ?

Thanks ever so much :slight_smile:

CFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Sam Snow
Sent: 16. mars 2005 19:51
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT on RHEL 4 with FastCGI Install Procedure

William Harrison said:

Here’s what I’ve done so far to install RT on RHEL 4 with the included
Apache2 package and FastCGI.

I’m still getting errors (Apache will not restart once it has been
configured). Any help would be greatly appreciated. INstall procedure
and
notes below.

Edit your Apache config file as well:

edit /etc/httpd/conf/httpd.conf

  <VirtualHost your.ip.address>
     ServerName rt.example.com
     DocumentRoot /opt/rt3/share/html
     AddDefaultCharset UTF-8
     PerlModule Apache2 Apache::compat
     PerlModule Apache::DBI
     PerlRequire /opt/rt3/bin/webmux.pl
     <Location />
         SetHandler perl-script
         PerlHandler RT::Mason
     </Location>
     RedirectMatch permanent (.*)/$

http://128.150.142.104$1/index.html

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

Are you planning on using FastCgi? Your apache config is for a mod_perl
based install, not a fastcgi based one.

I posted what worked for me fastcgi+apache2 a few days ago. I will
forward
it to you directly.

Sam

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

RT Administrator and Developer training is coming to your town soon!
(Boston, San Francisco, Austin, Sydney) Contact
training@bestpractical.com for details.

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

As requested, here is the most recent version of the procedure for installing RT on RHEL 4 with MySQL and FastCGI. Note that things still do not work…

Apache’s error_log file fills up rapidly, approx. one error per second, similar to the following:
[timestamp] [crit] (13)Permission denied: FastCGI: can’t create server “/opt/rt3/bin/mason_handler.fcgi”: bind() failed [/var/log/fastcgi/362fab4db3d651b6d082c0358ebb4d83]

Best of luck to those of you trying to get it working. Let me know if you have any suggestions…

-William

RT INSTALLATION PROCEDURE 20050317:

Standard install of RHEL, then upgrade / up2date / whatever to get latest versions. For me, that looks like:
httpd-2.0.52-9.ent
httpd-devel-2.0.52-9.ent
mysql-4.1.7-4.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-server-4.1.7-4.RHEL4.1
mysql-devel-4.1.7-4.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1

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

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

RT requires its own group, so let’s add it now lest we forget:

groupadd rt

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

WARNING: Starting Apache now will result in a successful start, and an abilty to serve non-RT related pages only.
Your error_log file will fill up rapidly, approximatly one error per second, similar to the following:
[timestamp] [crit] (13)Permission denied: FastCGI: can’t create server “/opt/rt3/bin/mason_handler.fcgi”: bind() failed [/var/log/fastcgi/362fab4db3d651b6d082c0358ebb4d83]-----Original Message-----
From: Bech-Yagher, Cirstyn [mailto:CBY@Teleplan.no]
Sent: Thursday, March 17, 2005 9:16 AM
To: Sam Snow; rt-users@lists.bestpractical.com
Subject: RE: [rt-users] RT on RHEL 4 with FastCGI Install Procedure

Hi,

I’m also struggling with the apache/mod_perl set-up, and was wondering
whether to change to fastcgi myself. Would it be possible to get a
forward as well or maybe you could post it to the list ?

Thanks ever so much :slight_smile:

C