<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=MultipleInstances</id>
	<title>MultipleInstances - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=MultipleInstances"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=MultipleInstances&amp;action=history"/>
	<updated>2026-08-22T05:26:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=MultipleInstances&amp;diff=2268&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=MultipleInstances&amp;diff=2268&amp;oldid=prev"/>
		<updated>2016-04-06T20:15:44Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= How to Run Multiple RT Instances =&lt;br /&gt;
&lt;br /&gt;
An /instance/ is a combination of:&lt;br /&gt;
&lt;br /&gt;
* Specific MySQL database, to hold a specific set of users, tickets, scrips, etc&lt;br /&gt;
* RT core&lt;br /&gt;
* Customizations, including config file, gui, code&lt;br /&gt;
&lt;br /&gt;
This article shows various ways of running multiple instances on the same apache process, with each instance using a different url. Note that solution use [[FastCGI]], because different FastCGI processes can have different code loaded at the same RT::* namespace. With RT-3.4.4 and mod_perl2.0 you can have several RT instances, but mod_perl1 is &amp;#039;&amp;#039;&amp;#039;not suitable&amp;#039;&amp;#039;&amp;#039;, it uses a single perl interpreter for the server instance.&lt;br /&gt;
&lt;br /&gt;
== Simple Answer ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;nowiki&amp;gt;!FastCGI&amp;lt;/nowiki&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The simplest solution is to install RT multiple times into completely separate directory trees. Then launch a FastCGI process for each install, and connect each FastCGI process to a unique url.&lt;br /&gt;
&lt;br /&gt;
So, assume you have installed RT in &amp;lt;code&amp;gt;/rt1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/rt2&amp;lt;/code&amp;gt; and you wish to connect these to these urls&lt;br /&gt;
&lt;br /&gt;
 http://myrt.com/rt1&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 http://myrt.com/rt2&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
You can set up apache this way:&lt;br /&gt;
&lt;br /&gt;
 AddHandler fastcgi-script fcgi&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;Directory &amp;quot;/rt1&amp;quot; &amp;amp;gt;&lt;br /&gt;
     Options FollowSymLinks ExecCGI&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 FastCgiServer /rt1/bin/mason_handler.fcgi&lt;br /&gt;
 ScriptAlias /rt1 /rt1/bin/mason_handler.fcgi&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;Directory &amp;quot;/rt2&amp;quot; &amp;amp;gt;&lt;br /&gt;
     Options FollowSymLinks ExecCGI&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 FastCgiServer /rt2/bin/mason_handler.fcgi&lt;br /&gt;
 ScriptAlias /rt2 /rt2/bin/mason_handler.fcgi&lt;br /&gt;
&lt;br /&gt;
=== mod_perl 2.x ===&lt;br /&gt;
&lt;br /&gt;
Use RT 3.4.4 or greater and install it as described in FastCGI section above, but in apache config use:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;VirtualHost your.ip.address&amp;amp;gt;&lt;br /&gt;
   ServerName your.rt1.server.hostname&lt;br /&gt;
   DocumentRoot /rt1/share/html&lt;br /&gt;
   AddDefaultCharset UTF-8&lt;br /&gt;
 &lt;br /&gt;
   PerlOptions +Parent&lt;br /&gt;
   PerlRequire /rt1/bin/webmux.pl&lt;br /&gt;
   &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
       SetHandler perl-script&lt;br /&gt;
       PerlHandler RT::Mason&lt;br /&gt;
   &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;VirtualHost your.ip.address&amp;amp;gt;&lt;br /&gt;
   ServerName your.rt2.server.hostname&lt;br /&gt;
   DocumentRoot /rt2/share/html&lt;br /&gt;
   AddDefaultCharset UTF-8&lt;br /&gt;
 &lt;br /&gt;
   PerlOptions +Parent&lt;br /&gt;
   PerlRequire /rt2/bin/webmux.pl&lt;br /&gt;
   &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
       SetHandler perl-script&lt;br /&gt;
       PerlHandler RT::Mason&lt;br /&gt;
   &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Features, Better Maintenance ==&lt;br /&gt;
&lt;br /&gt;
The simple answer works, but does nothing to ease the sharing of customizations between instances, nor the testing and installation of RT upgrades, nor the creation of new instances.&lt;br /&gt;
&lt;br /&gt;
I have multiple departments, each of which needs a separate RT instance. Each instance needs a separate config file, and possibly separate gui or code customizations, as well as access to site-wide customizations. I want:&lt;br /&gt;
&lt;br /&gt;
* Single install of base RT code per RT version.&lt;br /&gt;
* Single set of site-wide mods per RT version.&lt;br /&gt;
* Separate directory tree per set of local customizations, containing the minimum number of files.&lt;br /&gt;
* Trivial way to make an instance by combining any set of local customizations with any RT version.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Suppose the English and Physics departments each use RT, version 3.0.8. Now the Math department wants an instance, with no mods.&lt;br /&gt;
&lt;br /&gt;
* Create new MySQL database, /rt_math/&lt;br /&gt;
* Create new directory tree to hold math config, &amp;lt;code&amp;gt;/rt-math&amp;lt;/code&amp;gt;&lt;br /&gt;
* Create needed mail aliases&lt;br /&gt;
* Configure apache to connect [http://myrt.com/math =] with a new fastcgi process that runs the existing RT-3.0.8 code but uses [=/rt-math/etc/[[RT SiteConfig|RT_SiteConfig]].pm]&lt;br /&gt;
&lt;br /&gt;
Now Math wants some customizations, maybe change a logo on their page, something that requires a change to a Mason or RT component.&lt;br /&gt;
&lt;br /&gt;
* Add the new file to &amp;lt;code&amp;gt;/rt-math/local/html/...&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/rt-math/local/lib/RT/...&amp;lt;/code&amp;gt; in the usual way. Use &amp;lt;code&amp;gt;..._Local.pm&amp;lt;/code&amp;gt; for RT overlays, or Mason callbacks as needed.&lt;br /&gt;
* Restart apache.&lt;br /&gt;
&lt;br /&gt;
Now RT 3.0.9 comes out. I need to upgrade, test, install.&lt;br /&gt;
&lt;br /&gt;
* Install into &amp;lt;code&amp;gt;/rt-3.0.9&amp;lt;/code&amp;gt; and apply site-wide mods as needed.&lt;br /&gt;
* Configure apache to use [http://myrt.com/physics-test =] and connect this to a new fastcgi process that combines the existing &amp;lt;code&amp;gt;/rt-physics&amp;lt;/code&amp;gt; instance and the new &amp;lt;code&amp;gt;/rt-3.0.9&amp;lt;/code&amp;gt; code. (Note this uses the existing live MySQL data. The truly paranoid would copy the data to a test MySQL database and copy the instance code to &amp;lt;code&amp;gt;/rt-physics-test&amp;lt;/code&amp;gt; first.)&lt;br /&gt;
* Restart apache.&lt;br /&gt;
* When satisfied with testing, simply change apache config so that the production url, [http://myrt.com/physics =] refers to a fastcgi process that uses &amp;lt;code&amp;gt;/rt-3.0.9&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/rt-physics&amp;lt;/code&amp;gt;&lt;br /&gt;
* Test /math/ and /english/ separately, if their customizations need this. Otherwise just configure apache/fastcgi to use 3.0.9 instead of 3.0.8.&lt;br /&gt;
&lt;br /&gt;
=== Technical Details - Overview ===&lt;br /&gt;
&lt;br /&gt;
The key to using the same RT code with instance-specific directory trees lies in modifying some internal paths in RT.pm, such as &amp;lt;code&amp;gt;$SITE_CONFIG_FILE&amp;lt;/code&amp;gt;, [=$[[LocalPath]]], and so on. Normally these are set at compile time, but a small mod lets the compiled values be overridden by an environment variable, and this variable can be specificed in apache as an argument to the [=[[FastCgiServer]]] directive.&lt;br /&gt;
&lt;br /&gt;
Thus the [=[[FastCgiServer]]] directive can contain the path to the &amp;lt;code&amp;gt;mason_handler.fcgi&amp;lt;/code&amp;gt; file (which specifies which base RT install to use) and separately an instance-specific environment variable (which specifies which instance-specific configs and mods to use).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Question:&amp;#039;&amp;#039;&amp;#039; I wonder if there is any way to use a pool of dynamic [[FastCGI]]. When I first read this I thought, oh, use mod_env to pass in the variable settings. But I bet RT loads and stores a lot of state based on the values of those variables, so I think it wouldn&amp;#039;t work. -- [[MarkBucciarelli]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The only files that need to know about this environment variable are &amp;lt;code&amp;gt;lib/RT.pm.in&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bin/webmux.pl.in&amp;lt;/code&amp;gt;. And it&amp;#039;s convenient to patch &amp;lt;code&amp;gt;sbin/rt-setup-database.in&amp;lt;/code&amp;gt; to make it easy to create new MySQL databases based on a new instance-specific config. The patches are small and do not affect anything unless the environment variables are set.&lt;br /&gt;
&lt;br /&gt;
In practice, I use two environment variables.&lt;br /&gt;
&lt;br /&gt;
* RT_INSTANCE_PATH -- Exactly as described above, this would be set to, e.g. &amp;lt;code&amp;gt;/rt-physics&amp;lt;/code&amp;gt; to use the physics instance values.&lt;br /&gt;
&lt;br /&gt;
* RT_VENDOR_PATH -- I use &amp;lt;code&amp;gt;..._Local.pm&amp;lt;/code&amp;gt; files for per-instance customizations, and &amp;lt;code&amp;gt;..._Vendor.pm&amp;lt;/code&amp;gt; files for site-wide customizations where I don&amp;#039;t want to directly patch the original files. I could use this environment variable to create a test instance with new site-wide mods, without re-installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Technical Details -- Checklist for Multiple Instance Installation ===&lt;br /&gt;
&lt;br /&gt;
* To install:&lt;br /&gt;
&lt;br /&gt;
** Unpack RT source&lt;br /&gt;
** Use the patch below&lt;br /&gt;
** Compile and install RT in the usual way. Assume this is installed in &amp;lt;code&amp;gt;/rt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* To create a new RT Instance (e.g. instance name &amp;lt;code&amp;gt;math&amp;lt;/code&amp;gt;, at [http://myrt.com/math =] whose files are in &amp;lt;code&amp;gt;/rt-math&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
** Set up the instance files in a separate directory tree, mirroring the RT tree. Minimally you will need [=/rt-math/etc/[[RT SiteConfig|RT_SiteConfig]].pm], but you might also have Mason customizations in &amp;lt;code&amp;gt;/rt-math/local/html/...&amp;lt;/code&amp;gt; or RT customizations in &amp;lt;code&amp;gt;/rt-math/lib/RT/...&amp;lt;/code&amp;gt;&lt;br /&gt;
** Create the MySQL database, something like:&lt;br /&gt;
&lt;br /&gt;
 sbin/rt-setup-database /rt-math --action=init --dba=root --prompt-for-dba-password&lt;br /&gt;
&lt;br /&gt;
** For fastcgi reasons, you must have a separately-named &amp;lt;code&amp;gt;mason_handler.fcgi&amp;lt;/code&amp;gt; even though that file does not need to be patched. I do this with a symlink:&lt;br /&gt;
&lt;br /&gt;
 cd /rt/bin&lt;br /&gt;
 ln -s mason_handler.fcgi mason_handler_math.fcgi&lt;br /&gt;
&lt;br /&gt;
** Now configure apache:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;Directory /rt/math &amp;amp;gt;&lt;br /&gt;
 Options FollowSymLinks ExecCGI&lt;br /&gt;
 AllowOverride None&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 FastCgiServer /rt/bin/mason_handler_math.fcgi -initial-env RT_INSTANCE_PATH=/rt-math&lt;br /&gt;
 ScriptAlias /math /rt/bin/mason_handler_math.fcgi&lt;br /&gt;
&lt;br /&gt;
** Set up any needed mail aliases in the normal way. Make sure they refer to [http://myrt.com/math =]&lt;br /&gt;
&lt;br /&gt;
=== Appendix -- Patch ===&lt;br /&gt;
&lt;br /&gt;
Here is an updated patch for RT 3.4.2 It has been minimally tested, so I would love input on it. No major changes except that I incorporated the comment at the bottom. Also a few changes to the context so it applies cleanly to 3.4.2, and I changed it to unified diff format.&lt;br /&gt;
&lt;br /&gt;
Apply this patch to the RT source before running configure. If you start in the top level RT directory, you should run:&lt;br /&gt;
&lt;br /&gt;
 patch -p1 &amp;amp;lt; patchfile&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here is the patchfile:&lt;br /&gt;
&lt;br /&gt;
 diff -ru rt-3.4.2-pristine/bin/webmux.pl.in rt-3.4.2/bin/webmux.pl.in&lt;br /&gt;
 --- rt-3.4.2-pristine/bin/webmux.pl.in  2005-05-11 20:36:48.064856616 -0400&lt;br /&gt;
 +++ rt-3.4.2/bin/webmux.pl.in   2005-05-11 20:39:43.540180312 -0400&lt;br /&gt;
 @@ -64,6 +64,12 @@&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  use lib ( &amp;quot;@LOCAL_LIB_PATH@&amp;quot;, &amp;quot;@RT_LIB_PATH@&amp;quot; );&lt;br /&gt;
 +if ($ENV{RT_INSTANCE_PATH}) {&lt;br /&gt;
 +    lib-&amp;amp;gt;import(&amp;quot;$ENV{RT_INSTANCE_PATH}/local/lib&amp;quot;);&lt;br /&gt;
 +}&lt;br /&gt;
 +if ($ENV{RT_VENDOR_PATH}) {&lt;br /&gt;
 +    lib-&amp;amp;gt;import($ENV{RT_VENDOR_PATH});&lt;br /&gt;
 +}&lt;br /&gt;
  use RT;&lt;br /&gt;
 &lt;br /&gt;
  package RT::Mason;&lt;br /&gt;
 diff -ru rt-3.4.2-pristine/lib/RT.pm.in rt-3.4.2/lib/RT.pm.in&lt;br /&gt;
 --- rt-3.4.2-pristine/lib/RT.pm.in      2005-05-11 20:36:48.098851448 -0400&lt;br /&gt;
 +++ rt-3.4.2/lib/RT.pm.in       2005-05-11 20:41:52.026647400 -0400&lt;br /&gt;
 @@ -98,6 +98,60 @@&lt;br /&gt;
  # via the web interface)&lt;br /&gt;
  $MasonSessionDir = &amp;#039;@MASON_SESSION_PATH@&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
 +=item import&lt;br /&gt;
 +&lt;br /&gt;
 +Allow override of various internal paths.&lt;br /&gt;
 +&lt;br /&gt;
 +    RT-&amp;amp;gt;import (&lt;br /&gt;
 +            RT_INSTANCE_PATH =&amp;amp;gt; &amp;#039;/usr/local/rt/stuff&amp;#039;,&lt;br /&gt;
 +            SITE_CONFIG_FILE =&amp;amp;gt; &amp;#039;/etc/stuff.pm&amp;#039;,&lt;br /&gt;
 +              ...&lt;br /&gt;
 +    );&lt;br /&gt;
 +&lt;br /&gt;
 +If RT_INSTANCE_PATH is set in the arguments (or in %ENV)&lt;br /&gt;
 +then it replaces the old value of $BasePath in the following&lt;br /&gt;
 +variables:&lt;br /&gt;
 +  $SITE_CONFIG_FILE&lt;br /&gt;
 +  $LocalPath&lt;br /&gt;
 +  $LocalEtcPath&lt;br /&gt;
 +  $LocalLexiconPath&lt;br /&gt;
 +  $MasonLocalComponentRoot&lt;br /&gt;
 +  $MasonDataDir&lt;br /&gt;
 +  $MasonSessionDir&lt;br /&gt;
 +&lt;br /&gt;
 +Beyond that, those individual values can be set explicitly&lt;br /&gt;
 +by arguments.&lt;br /&gt;
 +&lt;br /&gt;
 +=cut&lt;br /&gt;
 +&lt;br /&gt;
 +sub import {&lt;br /&gt;
 +no strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
 +    shift;&lt;br /&gt;
 +    my %args = @_;&lt;br /&gt;
 +    return unless %args || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 +&lt;br /&gt;
 +    my @variables = qw (&lt;br /&gt;
 +        SITE_CONFIG_FILE&lt;br /&gt;
 +        LocalPath&lt;br /&gt;
 +        LocalEtcPath&lt;br /&gt;
 +        LocalLexiconPath&lt;br /&gt;
 +        MasonLocalComponentRoot&lt;br /&gt;
 +        MasonDataDir&lt;br /&gt;
 +        MasonSessionDir&lt;br /&gt;
 +    );&lt;br /&gt;
 +&lt;br /&gt;
 +    my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PAT&lt;br /&gt;
 &lt;br /&gt;
 + if ($RT_INSTANCE_PATH) {&lt;br /&gt;
 + foreach my $vref (@variables) {&lt;br /&gt;
 + $$vref =~ s/^\Q$BasePath\E/$RT_INSTANCE_PATH/;&lt;br /&gt;
 + }&lt;br /&gt;
 + }&lt;br /&gt;
 + foreach my $vref (@variables) {&lt;br /&gt;
 + $$vref = $args{$vref} if defined ( $args{$vref} );&lt;br /&gt;
 + }&lt;br /&gt;
 +&lt;br /&gt;
 +use strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
 +}&lt;br /&gt;
&lt;br /&gt;
 diff -ru rt-3.4.2-pristine/sbin/rt-setup-database.in rt-3.4.2/sbin/rt-setup-database.in&lt;br /&gt;
 --- rt-3.4.2-pristine/sbin/rt-setup-database.in 2005-05-11 20:36:48.128846888 -0400&lt;br /&gt;
 +++ rt-3.4.2/sbin/rt-setup-database.in 2005-05-11 20:45:35.800628584 -0400&lt;br /&gt;
 @@ -50,11 +50,17 @@&lt;br /&gt;
 qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips);&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;use lib &amp;quot;@RT_LIB_PATH@&amp;quot;;&lt;br /&gt;
 +## RT_INSTANCE_PATH can be passed on command line.&lt;br /&gt;
 +## Can change where RT_SiteConfig is read from.&lt;br /&gt;
 +my $RT_INSTANCE_PATH;&lt;br /&gt;
 +BEGIN {&lt;br /&gt;
 + $RT_INSTANCE_PATH = shift || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 +}&lt;br /&gt;
 &lt;br /&gt;
 #This drags in RT&amp;#039;s config.pm&lt;br /&gt;
 # We do it in a begin block because RT::Handle needs to know the type to do its&lt;br /&gt;
 # inheritance&lt;br /&gt;
 -use RT;&lt;br /&gt;
 +use RT (RT_INSTANCE_PATH =&amp;amp;gt; $RT_INSTANCE_PATH);&lt;br /&gt;
 use Carp;&lt;br /&gt;
 use RT::User;&lt;br /&gt;
 use RT::CurrentUser;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
I would love people to test this out. I have only minimally tested it. For comparison to the older version, please look in the revisions.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*** Who are you? Identify yourself so that we can give feedback. &amp;#039;&amp;#039;&amp;#039;*&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The patch works great for me. The only caveat I found was that I had to create separate copies of rt-crontool for each instance. For rt-crontool, I had to modify the &amp;quot;use lib&amp;quot; line (50) to be instance-specific:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
# diff rt-crontool rt-crontool-testinstance1 50c50 &amp;amp;lt; use lib (&amp;quot;/var/rt3/local/lib&amp;quot;, &amp;quot;/var/rt3/lib&amp;quot;); --- &amp;amp;gt; use lib (&amp;quot;/var/rt3_testinstance1/local/lib&amp;quot;, &amp;quot;/var/rt3_testinstance1/lib&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Your paths will vary depending on how you configured your queues. Presumably this would be necessary for standalone_httpd and webmux.pl as well, if you use those scripts. -SJ&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I got the patch to work with on a Debian Stable (Sarge) install (RT v3.4.4) but with some twists:&lt;br /&gt;
&lt;br /&gt;
- Instance configs are stored in /usr/local/share/instance1 - I don&amp;#039;t pass the instance name to fcgi with a &amp;quot;/&amp;quot; - I also set the instance config paths in RT.pm differently - Segmented location of Mason Cache files in /var/cache/request-tracker3.4 into instance relevant dirs.&lt;br /&gt;
&lt;br /&gt;
The change in webmux.pl comes after this line (about line 65)&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#&lt;br /&gt;
 # START Multi-Instance Patch Segment&lt;br /&gt;
 #&lt;br /&gt;
 if ($ENV{RT_INSTANCE_PATH}) {&lt;br /&gt;
     lib-&amp;amp;gt;import(&amp;quot;/usr/local/share/rtinst/&amp;quot; . $ENV{RT_INSTANCE_PATH} . &amp;quot;/lib&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 if ($ENV{RT_VENDOR_PATH}) {&lt;br /&gt;
     lib-&amp;amp;gt;import($ENV{RT_VENDOR_PATH});&lt;br /&gt;
 }&lt;br /&gt;
 #&lt;br /&gt;
 # END Multi-Instance Patch Segment&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes in RT.pm are after the following lines (around line 97):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# RT needs to put session data (for preserving state between connections&lt;br /&gt;
 # via the web interface)&lt;br /&gt;
 $MasonSessionDir = &amp;#039;/var/cache/request-tracker3.4/session_data&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # START Multi-Instance Patch&lt;br /&gt;
 #&lt;br /&gt;
 =item import&lt;br /&gt;
 &lt;br /&gt;
 Allow override of various internal paths.&lt;br /&gt;
 &lt;br /&gt;
     RT-&amp;amp;gt;import (&lt;br /&gt;
             RT_INSTANCE_PATH =&amp;amp;gt; &amp;#039;/usr/share/request-tracker3.4&amp;#039;,&lt;br /&gt;
             SITE_CONFIG_FILE =&amp;amp;gt; &amp;#039;/etc/stuff.pm&amp;#039;,&lt;br /&gt;
               ...&lt;br /&gt;
     );&lt;br /&gt;
 &lt;br /&gt;
 If RT_INSTANCE_PATH is set in the arguments (or in %ENV)&lt;br /&gt;
 then it replaces the old value of $BasePath in the following&lt;br /&gt;
 variables:&lt;br /&gt;
   $SITE_CONFIG_FILE&lt;br /&gt;
   $LocalPath&lt;br /&gt;
   $LocalEtcPath&lt;br /&gt;
   $LocalLexiconPath&lt;br /&gt;
   $MasonLocalComponentRoot&lt;br /&gt;
   $MasonDataDir&lt;br /&gt;
   $MasonSessionDir&lt;br /&gt;
 &lt;br /&gt;
 Beyond that, those individual values can be set explicitly&lt;br /&gt;
 by arguments.&lt;br /&gt;
 &lt;br /&gt;
 =cut&lt;br /&gt;
 &lt;br /&gt;
 sub import {&lt;br /&gt;
 no strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
     shift;&lt;br /&gt;
     my $InstancesLocalBasePath = &amp;#039;/usr/local/share/rtinst&amp;#039;;&lt;br /&gt;
     my %args = @_;&lt;br /&gt;
     return unless %args || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 &lt;br /&gt;
     my @variables = qw (&lt;br /&gt;
         SITE_CONFIG_FILE&lt;br /&gt;
         LocalPath&lt;br /&gt;
         LocalEtcPath&lt;br /&gt;
         LocalLexiconPath&lt;br /&gt;
         MasonLocalComponentRoot&lt;br /&gt;
         MasonDataDir&lt;br /&gt;
         MasonSessionDir&lt;br /&gt;
     );&lt;br /&gt;
 &lt;br /&gt;
     my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 &lt;br /&gt;
  if ($RT_INSTANCE_PATH) {&lt;br /&gt;
     $CORE_CONFIG_FILE = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/etc/RT_Config.pm&amp;quot;;&lt;br /&gt;
     $SITE_CONFIG_FILE = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/etc/RT_SiteConfig.pm&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
     $EtcPath = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;etc&amp;quot;;&lt;br /&gt;
     $LocalPath = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH;&lt;br /&gt;
     $LocalEtcPath = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/etc&amp;quot;;&lt;br /&gt;
     $LocalLexiconPath = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/po&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
     # $MasonLocalComponentRoot is where your rt instance keeps its site-local&lt;br /&gt;
     # mason html files.&lt;br /&gt;
 &lt;br /&gt;
     $MasonLocalComponentRoot = $InstancesLocalBasePath . &amp;quot;/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/html&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
     # $MasonDataDir Where mason keeps its datafiles&lt;br /&gt;
 &lt;br /&gt;
     $MasonDataDir = &amp;quot;/var/cache/request-tracker3.4/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/mason_data&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
     # RT needs to put session data (for preserving state between connections&lt;br /&gt;
     # via the web interface)&lt;br /&gt;
     $MasonSessionDir = &amp;quot;/var/cache/request-tracker3.4/&amp;quot; . $RT_INSTANCE_PATH . &amp;quot;/session_data&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 use strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
 }&lt;br /&gt;
 #&lt;br /&gt;
 # END Multi-Instance Patch&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hope that&amp;#039;s helpful to someone...&lt;br /&gt;
&lt;br /&gt;
[[MichaelErana]] &amp;lt;u&amp;gt;g33k (at) efamilynj.org&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve done a patch for 3.6 that is actually applicable (I can&amp;#039;t copy-paste the original patch above) and detailed procedures for [[FreeBSD]] in our wiki (http://wiki.koumbit.net/RequestTracker/InstallAndConfig#head-multiple-instance-setup). -- [[TheAnarcat]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I needed this to work in version 3.8.1 and believe I have made the proper edits. It works for me anyway. -- jhoov&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--- rt-3.8.1/sbin/rt-setup-database.in	2008-08-18 11:13:58.000000000 -0400&lt;br /&gt;
 +++ rt-3.8.1-multiple/sbin/rt-setup-database.in	2008-10-22 16:30:50.000000000 -0400&lt;br /&gt;
 @@ -76,11 +76,18 @@&lt;br /&gt;
 &lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 +## RT_INSTANCE_PATH can be passed in environment.&lt;br /&gt;
 +## Can change where RT_SiteConfig is read from.&lt;br /&gt;
 +my $RT_INSTANCE_PATH;&lt;br /&gt;
 +BEGIN {&lt;br /&gt;
 + $RT_INSTANCE_PATH = $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 +}&lt;br /&gt;
 +&lt;br /&gt;
  #This drags in  RT&amp;#039;s config.pm&lt;br /&gt;
  # We do it in a begin block because RT::Handle needs to know the type to do its&lt;br /&gt;
  # inheritance&lt;br /&gt;
  BEGIN {&lt;br /&gt;
 -    use RT;&lt;br /&gt;
 +    use RT (RT_INSTANCE_PATH =&amp;amp;gt; $RT_INSTANCE_PATH);&lt;br /&gt;
      RT::LoadConfig();&lt;br /&gt;
      RT::InitClasses();&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 --- rt-3.8.1/bin/webmux.pl.in	2008-08-18 11:14:11.000000000 -0400&lt;br /&gt;
 +++ rt-3.8.1-multiple/bin/webmux.pl.in	2008-10-22 16:42:09.000000000 -0400&lt;br /&gt;
 @@ -70,6 +70,10 @@&lt;br /&gt;
      my @libs = (&amp;quot;@RT_LIB_PATH@&amp;quot;, &amp;quot;@LOCAL_LIB_PATH@&amp;quot;);&lt;br /&gt;
      my $bin_path;&lt;br /&gt;
 &lt;br /&gt;
 +    if ($ENV{RT_INSTANCE_PATH}) {&lt;br /&gt;
 +        push(@libs, &amp;quot;$ENV{RT_INSTANCE_PATH}/local/lib&amp;quot;);&lt;br /&gt;
 +    }&lt;br /&gt;
 +&lt;br /&gt;
      for my $lib (@libs) {&lt;br /&gt;
          unless ( File::Spec-&amp;amp;gt;file_name_is_absolute($lib) ) {&lt;br /&gt;
              unless ($bin_path) {&lt;br /&gt;
 &lt;br /&gt;
 --- rt-3.8.1/lib/RT/Config.pm	2008-08-18 11:14:11.000000000 -0400&lt;br /&gt;
 +++ rt-3.8.1-multiple/lib/RT/Config.pm	2008-10-22 16:30:29.000000000 -0400&lt;br /&gt;
 @@ -368,11 +368,16 @@&lt;br /&gt;
  sub LoadConfig {&lt;br /&gt;
      my $self = shift;&lt;br /&gt;
      my %args = ( File =&amp;amp;gt; &amp;#039;&amp;#039;, @_ );&lt;br /&gt;
 +    my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
      $args{&amp;#039;File&amp;#039;} =~ s/(?&amp;amp;lt;!Site)(?=Config\.pm$)/Site/;&lt;br /&gt;
      if ( $args{&amp;#039;File&amp;#039;} eq &amp;#039;RT_SiteConfig.pm&amp;#039;&lt;br /&gt;
          and my $site_config = $ENV{RT_SITE_CONFIG} )&lt;br /&gt;
      {&lt;br /&gt;
          $self-&amp;amp;gt;_LoadConfig( %args, File =&amp;amp;gt; $site_config );&lt;br /&gt;
 +    } elsif ( $args{&amp;#039;File&amp;#039;} eq &amp;#039;RT_SiteConfig.pm&amp;#039;&lt;br /&gt;
 +        and $RT_INSTANCE_PATH )&lt;br /&gt;
 +    {&lt;br /&gt;
 +        $self-&amp;amp;gt;_LoadConfig( %args, File =&amp;amp;gt; $RT_INSTANCE_PATH.&amp;quot;/etc/RT_SiteConfig.pm&amp;quot; );&lt;br /&gt;
      } else {&lt;br /&gt;
          $self-&amp;amp;gt;_LoadConfig(%args);&lt;br /&gt;
      }&lt;br /&gt;
 &lt;br /&gt;
 --- rt-3.8.1/lib/RT.pm.in	2008-08-18 11:14:11.000000000 -0400&lt;br /&gt;
 +++ rt-3.8.1-multiple/lib/RT.pm.in	2008-10-22 16:30:40.000000000 -0400&lt;br /&gt;
 @@ -117,6 +117,57 @@&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 +=item import&lt;br /&gt;
 +&lt;br /&gt;
 +Allow override of various internal paths.&lt;br /&gt;
 +&lt;br /&gt;
 +    RT-&amp;amp;gt;import (&lt;br /&gt;
 +            RT_INSTANCE_PATH =&amp;amp;gt; &amp;#039;/usr/local/rt/stuff&amp;#039;,&lt;br /&gt;
 +              ...&lt;br /&gt;
 +    );&lt;br /&gt;
 +&lt;br /&gt;
 +If RT_INSTANCE_PATH is set in the arguments (or in %ENV)&lt;br /&gt;
 +then it replaces the old value of $BasePath in the following&lt;br /&gt;
 +variables:&lt;br /&gt;
 +  $LocalPath&lt;br /&gt;
 +  $LocalEtcPath&lt;br /&gt;
 +  $LocalLexiconPath&lt;br /&gt;
 +  $MasonLocalComponentRoot&lt;br /&gt;
 +  $MasonDataDir&lt;br /&gt;
 +  $MasonSessionDir&lt;br /&gt;
 +&lt;br /&gt;
 +Beyond that, those individual values can be set explicitly&lt;br /&gt;
 +by arguments.&lt;br /&gt;
 +&lt;br /&gt;
 +=cut&lt;br /&gt;
 +&lt;br /&gt;
 +sub import {&lt;br /&gt;
 +no strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
 +    shift;&lt;br /&gt;
 +    my %args = @_;&lt;br /&gt;
 +    return unless %args || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 +&lt;br /&gt;
 +    my @variables = qw (&lt;br /&gt;
 +        LocalPath&lt;br /&gt;
 +        LocalEtcPath&lt;br /&gt;
 +        LocalLexiconPath&lt;br /&gt;
 +        MasonLocalComponentRoot&lt;br /&gt;
 +        MasonDataDir&lt;br /&gt;
 +        MasonSessionDir&lt;br /&gt;
 +    );&lt;br /&gt;
 +&lt;br /&gt;
 +    my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PATH};&lt;br /&gt;
 +    if ($RT_INSTANCE_PATH) {&lt;br /&gt;
 +        foreach my $vref (@variables) {&lt;br /&gt;
 +            $$vref =~ s/^\Q$BasePath\E/$RT_INSTANCE_PATH/;&lt;br /&gt;
 +        }&lt;br /&gt;
 +    }&lt;br /&gt;
 +    foreach my $vref (@variables) {&lt;br /&gt;
 +        $$vref = $args{$vref} if defined ( $args{$vref} );&lt;br /&gt;
 +    }&lt;br /&gt;
 +&lt;br /&gt;
 +use strict &amp;#039;refs&amp;#039;;&lt;br /&gt;
 +}&lt;br /&gt;
 &lt;br /&gt;
 =head1 NAME&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>