How to run multiple instances of RT on a single instance of Apache

I’m an RT newbie and definitely not an Apache guru. I want to run multiple
RTs: one for testing and another for production. I’m trying to use name
based virtual hosts in httpd.conf to do this, but I get the following error:

Subroutine handler redefined at /var/lib/rt3/instance2/bin/webmux.pl line
122.

I’m using apache 1.3.29, mod_perl 1.29 (statically linked), and RT 3.0.6 on
RedHat Linux 9 (stock 2.4.20-6smp kernel). The Perl is stock from RedHat,
but I built apache and mod_perl.

Here’s the virtual host stuff from my httpd.conf. Perhaps there is a
better/different way to do this. Any help would be greatly appreciated.

— snip snip —
[…]
NameVirtualHost *

<VirtualHost *>
ServerName real_name.domain.com

<VirtualHost *>
ServerName alias1.domain.com
DocumentRoot /var/lib/rt3/instance1/share/html
AddDefaultCharset UTF-8
PerlModule Apache::DBI
PerlRequire /var/lib/rt3/instance1/bin/webmux.pl

SetHandler perl-script
PerlHandler RT::Mason

<VirtualHost *>
ServerName alias2.domain.com
DocumentRoot /var/lib/rt3/instance2/share/html
AddDefaultCharset UTF-8
PerlModule Apache::DBI
PerlRequire /var/lib/rt3/instance2/bin/webmux.pl

SetHandler perl-script
PerlHandler RT::Mason


[…]
— snip snip —

Thanks,

— Mike R. Prevost

I’ve got this working, but with fastcgi. You can’t use mod_perl
at least in any simple way, because each apache child will
have a single namespace for perl modules, e.g. RT::…
So when webmux1.pl does ‘use RT;’ and webmux2.pl also
does a ‘use RT;’ even with a different @INC, they collide
in the RT space.

Fastcgi uses different processes, one for each instance of RT
Each process can have its own perl space, so no collisions.

If you’re interested, contact me privately. I’ve made some
minor modes to RT to make this process easier and more
maintainable. If I can explain it to you, then I can
explain it to everyone else as well :slight_smile:

bobg

Mike R. Prevost wrote:

I’m an RT newbie and definitely not an Apache guru. I want to run multiple
RTs: one for testing and another for production. I’m trying to use name
based virtual hosts in httpd.conf to do this, but I get the following error:

Subroutine handler redefined at /var/lib/rt3/instance2/bin/webmux.pl line
122.

I’m using apache 1.3.29, mod_perl 1.29 (statically linked), and RT 3.0.6 on
RedHat Linux 9 (stock 2.4.20-6smp kernel). The Perl is stock from RedHat,
but I built apache and mod_perl.

Here’s the virtual host stuff from my httpd.conf. Perhaps there is a
better/different way to do this. Any help would be greatly appreciated.

It’s imposible with only mod_perl handler and one apache instance.

Mike R. Prevost wrote:

I’m an RT newbie and definitely not an Apache guru. I want to run
multiple RTs: one for testing and another for production.

Perhaps there is a
better/different way to do this. Any help would be greatly
appreciated.

It’s imposible with only mod_perl handler and one apache instance.

But there’s no reason you couldn’t run two (or more) apache instances.
Especially if you want to use one for testing only.

What about running another Apache instance on a different port for your
development instance? That would allow you to test Apache configuration
changes as well without buggering up your production RT, and since your
httpd.conf files would be nearly identical it would be easy to port any
changes to production.

m