Second Instance Of RT (for branding purposes)

I’m trying to setup a second instance of RT that has a different branding,
but uses the same SQL server, etc.

I copied my existing (and working) RT installation over to a new directory.
Then I created the new instance in Apache in the httpd.conf, changing the
file locations to the new directories. Then I edited the RT_SiteConfig.pm
file to reflect the new file locations.

For some reason, the errors are showing up in the original directory’s logs
and the error returned is:
[Mon Feb 23 15:47:56 2009] [warning]: [Mason] Cannot resolve file to
component: /opt/rt3-[NEWBRAND]/share/html/index.html (is file outside
component root?) at
/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 853.
(/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm:853)

The browser returns a 404 error.

What am I missing? Is it not possible to run two RT instances on the same
server?

Sincerely,
Doug Eubanks
admin@dougware.net

Doug;

Are you using fast cgi , or mod_perl ??, with fastcgi you can run as
many instances you want --sorry I don’t use so I do n’t have working
apache config,
with mod_perl you suppose to only run one instance due to how the
mod_perl/mason work, however I did find a work around and this is how I
got my instances working:

for each instance (brand), I have
RT_SiteConfig_brandx.pm (all in /opt/rt3/local/etc/ )
webmux-brandx.pl (which is a copy of webmux.pl adding the line
$ENV{‘SERVER’} = ‘my_brandx_instance.com’; #at the top where the rest
of $ENV is being defined

Modify local/lib/RT.pm adding :

if ($ENV{‘SERVER’} eq ‘my_brandx_instance.com’ ) {
$SITE_CONFIG_FILE = ‘/opt/rt3/local/etc/RT_SiteConfig_brandx.pm’ ;
}elsif ($ENV{‘SERVER’} eq ‘my_brandy_instance.com’ ) {
$SITE_CONFIG_FILE = ‘/opt/rt3/local/etc/RT_SiteConfig_brandy.pm’ ;
}

You add these lines @ the top/start of sub LoadConfig

In you httpd.conf you call the correct webmux for your instance:
PerlRequire /opt/rt3/bin/webmux-brandx.pl

Thats it, the above setup allow you to share the same RT directory , so
customisation is easier,

Hope that helps,

Regards;
Roy

Doug Eubanks wrote:

I’m trying to setup a second instance of RT that has a different
branding, but uses the same SQL server, etc.

I copied my existing (and working) RT installation over to a new
directory. Then I created the new instance in Apache in the
httpd.conf, changing the file locations to the new directories. Then
I edited the RT_SiteConfig.pm file to reflect the new file locations.

For some reason, the errors are showing up in the original directory’s
logs and the error returned is:
[Mon Feb 23 15:47:56 2009] [warning]: [Mason] Cannot resolve file to
component: /opt/rt3-[NEWBRAND]/share/html/index.html (is file outside
component root?) at
/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 853.
(/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm:853)

The browser returns a 404 error.

What am I missing? Is it not possible to run two RT instances on the
same server?

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

http://www.vialtus.com/disclaimer.html

I’m so close now…but it’s always selecting brandy (the new brand). I’m
sure it’s something small and simply that I’m missing now. I really
appreciate your help so far.

I know the whole brandx, brandy thing is a little confusing. I’ve double
checked all of the refences below, and brandx and brandy are used the
correct spots in each code snippet below.

Here is the output of the foo file that shows that the ENV variables are
being set:

tickets.brandy.com http://tickets.brandy.com
tickets.brandx.com http://tickets.brandx.com
tickets.brandy.com http://tickets.brandy.com
tickets.brandx.com http://tickets.brandx.com
tickets.brandy.com http://tickets.brandy.com
tickets.brandx.com http://tickets.brandx.com
tickets.brandy.com http://tickets.brandy.com
tickets.brandx.com http://tickets.brandx.com
tickets.brandy.com http://tickets.brandy.com
tickets.brandx.com http://tickets.brandx.com

I’ve double checked the httpd.conf file, inside of the brandy site, we have
PerlRequire /opt/rt3/bin/webmux-brandy.pl

Inside of the brandx site, we have
PerlRequire /opt/rt3/bin/webmux.pl

Here’s my webmux.pl changes for the old brand:
#This drags in RT’s config.pm
BEGIN {
$ENV{‘SERVER’} = ‘tickets.brandx.com http://tickets.brandx.com’;
RT::LoadConfig();
if ($RT::DevelMode) { require Module::Refresh; }
}

Here’s my webmux-brandy.pl changes for the old brand:
#This drags in RT’s config.pm
BEGIN {
$ENV{‘SERVER’} = ‘tickets.brandy.com http://tickets.brandy.com’;
RT::LoadConfig();
if ($RT::DevelMode) { require Module::Refresh; }
}

This is my RT.pm LoadConfig sub, right before it stats and loads the site
config file:
my $ser = $ENV{‘SERVER’} ;
open F, “>> /tmp/foo” ;
print F “$ser \n”;
close F;

if ($ENV{‘SERVER’} eq “tickets.brandy.com http://tickets.brandy.com”) {
$SITE_CONFIG_FILE = ‘/opt/rt3/etc/RT_SiteConfig-Refense.pm’ ;
}
if ($ENV{‘SERVER’} eq “tickets.brandx.com http://tickets.brandx.com”) {
$SITE_CONFIG_FILE = ‘/opt/rt3/etc/RT_SiteConfig.pm’ ;
}

Sincerely,
Doug Eubanks
admin@dougware.netOn Tue, Feb 24, 2009 at 9:53 AM, Raed El-Hames rfh@vialtus.com wrote:

Sorry Doug my mistake its been a long time since I did this:
we set :
$ENV{‘SERVER’} = 'my_brandx_instance.com http://my_brandx_instance.com
in the relavent webmux-brandx.pl , it would n’t have existed before …
The best bet to see if its loaded into ENV is by adding a print statement
in RT.pm LoadConfig, looking at my dev code I think I managed to do
something like
sub LoadConfig {

my $ser = $ENV{‘SERVER’} ;
open F, “>> /opt/rt3/bin/foo” ;
print F “$ser \n”;
close F;

if ($ENV{‘SERVER’} eq ‘my_brandx_instance.com <
http://my_brandx_instance.com>’ ) {
$SITE_CONFIG_FILE = ‘/opt/rt3/local/etc/RT_SiteConfig_brandx.pm’ ;
}

I think at the time of restarting apache something will be written to the
foo file

Roy

Doug Eubanks wrote:

Here is my relevant httpd.conf sections…I’ve sanitized the
hostnames…

<VirtualHost *:80>
CacheEnable disk /
ServerAdmin support@brandy.com mailto:support@brandy.com
DocumentRoot /opt/rt3/share/html
ServerName tickets.brandy.com http://tickets.brandy.com
ServerAlias tickets.brandy.com http://tickets.brandy.com
tickets2.brandy.com http://tickets2.brandy.com ticket.brandy.com <
http://ticket.brandy.com> ticket2.brandy.com http://ticket2.brandy.com
AddDefaultCharset UTF-8

PerlModule Apache::DBI
PerlRequire /opt/rt3/bin/webmux.pl

PerlSetVar MasonStaticSource true
PerlSetVar MasonBufferPreallocateSize 1073741824
PerlSetVar MasonDataCacheDefaults "cache_class=> SharedMemoryCache,
cache_de $
PerlSetVar MasonPreloads '/Elements/*'
PerlSetVar MasonCompRoot /opt/rt3

SetHandler perl-script
PerlHandler RT::Mason

Alias /titan /opt/rt3/share/html

ScriptAlias /titan/ /opt/rt3/share/html

<VirtualHost *:80>
CacheEnable disk /
ServerAdmin support@brandx.com mailto:support@brandx.com
DocumentRoot /opt/rt3/share/html
ServerName tickets.brandx.com http://tickets.brandx.com
ServerAlias tickets.brandx.com http://tickets.brandx.com
tickets2.brandx.com http://tickets2.brandx.com ticket.brandx.com <
http://ticket.brandx.com> ticket2.brandx.com http://ticket2.brandx.com
AddDefaultCharset UTF-8

PerlModule Apache::DBI
PerlRequire /opt/rt3/bin/webmux.pl

PerlSetVar MasonStaticSource true
PerlSetVar MasonBufferPreallocateSize 1073741824
PerlSetVar MasonDataCacheDefaults "cache_class=> SharedMemoryCache,
cache_de $
PerlSetVar MasonPreloads '/Elements/*'
PerlSetVar MasonCompRoot /opt/rt3

SetHandler perl-script
PerlHandler RT::Mason

Alias /refense /opt/rt3/share/html

ScriptAlias /refense/ /opt/rt3/share/html

ErrorLog logs/error_log-tickets

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

On Tue, Feb 24, 2009 at 5:45 AM, Raed El-Hames <rfh@vialtus.com <mailto: rfh@vialtus.com>> wrote:

Hi Doug;

Make sure you have
ServerName my_brandx_instance.com
http://my_brandx_instance.com http://my_brandx_instance.com
in your virtual host conf file;

<VirtualHost my_brandx.com:443 http://my_brandx.com:443>
ServerName my_brandx.com http://my_brandx.com
DocumentRoot /opt/rt3/share/html
etc etc

...

And remember to restart httpd …

Good luck;
Roy

Doug Eubanks wrote:

   I believe I see where you are going with this....

   My problem is that $ENV{'SERVER}, $ENV{'SERVER_NAME}, etc are
   not being set to anything.  When I had it print all the ENV
   variables to a temp file, it only printed 4 or 5 variables and
   they were stuff like "MOD_PERL" version, etc.

   For some reason, those environment variables are not set....

   Sincerely,
   Doug Eubanks
   admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>



   On Mon, Feb 23, 2009 at 12:35 PM, Raed El-Hames <rfh@vialtus.com <mailto:rfh@vialtus.com> <mailto:rfh@vialtus.com <mailto:rfh@vialtus.com>>> wrote:

      Doug;

      Are you using fast cgi , or mod_perl ??, with fastcgi you
   can run
      as many instances you want  --sorry I don't use so I do n't
   have
      working apache config,
      with mod_perl you suppose to only run one instance due to
   how the
      mod_perl/mason work, however I did find a work around and
   this is
      how I got my instances working:

      for each instance (brand), I have
      RT_SiteConfig_brandx.pm (all in /opt/rt3/local/etc/ )
      webmux-brandx.pl (which is a copy of webmux.pl adding the line
       $ENV{'SERVER'}    = 'my_brandx_instance.com
   <http://my_brandx_instance.com>
      <http://my_brandx_instance.com>'; #at the top where the
   rest of

      $ENV is being defined

      Modify local/lib/RT.pm adding :

      if ($ENV{'SERVER'} eq 'my_brandx_instance.com
   <http://my_brandx_instance.com>
      <http://my_brandx_instance.com>' ) {

            $SITE_CONFIG_FILE =
      '/opt/rt3/local/etc/RT_SiteConfig_brandx.pm' ;
      }elsif ($ENV{'SERVER'} eq 'my_brandy_instance.com
   <http://my_brandy_instance.com>
      <http://my_brandy_instance.com>' ) {

            $SITE_CONFIG_FILE =
      '/opt/rt3/local/etc/RT_SiteConfig_brandy.pm' ;
      }

      You add these lines @ the top/start of sub LoadConfig

      In you httpd.conf you call the correct webmux for your
   instance:
      PerlRequire /opt/rt3/bin/webmux-brandx.pl

      Thats it, the above setup allow you to share the same RT
   directory
      , so customisation is easier,

      Hope that helps,

      Regards;
      Roy


      Doug Eubanks wrote:

          I'm trying to setup a second instance of RT that has a
          different branding, but uses the same SQL server, etc.

          I copied my existing (and working) RT installation over
   to a
          new directory.  Then I created the new instance in
   Apache in
          the httpd.conf, changing the file locations to the new
          directories.  Then I edited the RT_SiteConfig.pm file to
          reflect the new file locations.

          For some reason, the errors are showing up in the original
          directory's logs and the error returned is:
          [Mon Feb 23 15:47:56 2009] [warning]: [Mason] Cannot
   resolve
          file to component:
   /opt/rt3-[NEWBRAND]/share/html/index.html
          (is file outside component root?) at

/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm
line 853.

(/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm:853)

          The browser returns a 404 error.

          What am I missing?  Is it not possible to run two RT
   instances
          on the same server?

          Sincerely,
          Doug Eubanks
          admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>
          <mailto:admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>>





      <http://www.vialtus.com/disclaimer.html>


*Roy El-hames *

ISP Systems

Vialtus Solutions

(formerly Pipex Business)

Direct Dial: +44(0) 208 587 6181

E-mail: rfh@vialtus.com mailto:rfh@vialtus.com
<mailto:rfh@vialtus.com mailto:rfh@vialtus.com>

Visit us on:

www.vialtus.com http://www.vialtus.com http://www.vialtus.com/

This email is subject to:

http://www.vialtus.com/disclaimer.html

*Roy El-hames *

ISP Systems

Vialtus Solutions

(formerly Pipex Business)

Direct Dial: +44(0) 208 587 6181

E-mail: rfh@vialtus.com mailto:rfh@vialtus.com

Visit us on:

www.vialtus.com http://www.vialtus.com/

This email is subject to:

http://www.vialtus.com/disclaimer.html

That’s what I have, two different webmux.pl files…

They are in the same /opt/rt3/bin folder…

The old brand is called webmux.pl, the new brand is called webmux-brandy.pl

They are called in httpd.conf with these two separate lines in their
respective host entries…
PerlRequire /opt/rt3/bin/webmux-brandy.pl
PerlRequire /opt/rt3/bin/webmux.pl

Sincerely,
Doug Eubanks
admin@dougware.netOn Tue, Feb 24, 2009 at 11:54 AM, Raed El-Hames rfh@vialtus.com wrote:

Doug;

Looking at the http conf file you sent below, you seem to call the same
webmux.pl

PerlRequire /opt/rt3/bin/webmux.pl

You 'll need to have multiple versions of webmux.pl in each version you
add the line
$ENV{‘SERVER’} = 'my_brand(?)_instance.com <
http://my_brandx_instance.com>

For example you have tickets.brandy.com http://tickets.brandy.com and
tickets.brandx.com http://tickets.brandy.com

httpd.conf :

<VirtualHost tickets.brandy.com http://tickets.brandy.com:80>
ServerName tickets.brandy.com http://tickets.brandy.com
DocumentRoot /opt/rt3/share/html
etc etc etc
PerlRequire /opt/rt3/bin/webmux-brandy http://tickets.brandy.com.pl

etc etc etc

<VirtualHost tickets.brandx.com http://tickets.brandy.com:80>
ServerName tickets.brandx.com http://tickets.brandy.com
DocumentRoot /opt/rt3/share/html
etc etc etc
PerlRequire /opt/rt3/bin/webmux-brandx http://tickets.brandy.com.pl

etc etc etc

Now webmux:
You should have atleast 2 copies in /opt/rt3/bin one called webmux-brandy <
http://tickets.brandy.com>.pl and the other webmux-brandx <
http://tickets.brandy.com>.pl

Edit webmux-brandy http://tickets.brandy.com.pl adding the line:
$ENV{‘SERVER’} = ‘tickets.brandy.com http://tickets.brandy.com’;
where ENV is being set
so basically you’ll end up with something similar to:

BEGIN {
$ENV{‘PATH’} = ‘/bin:/usr/bin’; # or whatever you
need
$ENV{‘CDPATH’} = ‘’ if defined $ENV{‘CDPATH’};
$ENV{‘SHELL’} = ‘/bin/sh’ if defined $ENV{‘SHELL’};
$ENV{‘ENV’} = ‘’ if defined $ENV{‘ENV’};
$ENV{‘IFS’} = ‘’ if defined $ENV{‘IFS’};
$ENV{‘SERVER’} = ‘tickets.brandy.com http://tickets.brandy.com’;

Now edit webmux-brandx http://tickets.brandy.com.pl adding the line
$ENV{‘SERVER’} = ‘tickets.brandx.com http://tickets.brandy.com’;
where ENV is being set
so basically you’ll end up with something similar to:

BEGIN {
$ENV{‘PATH’} = ‘/bin:/usr/bin’; # or whatever you
need
$ENV{‘CDPATH’} = ‘’ if defined $ENV{‘CDPATH’};
$ENV{‘SHELL’} = ‘/bin/sh’ if defined $ENV{‘SHELL’};
$ENV{‘ENV’} = ‘’ if defined $ENV{‘ENV’};
$ENV{‘IFS’} = ‘’ if defined $ENV{‘IFS’};
$ENV{‘SERVER’} = ‘tickets.brandy.com http://tickets.brandy.com’;

Now RT.pm
at the start of sub LoadConfig add the lines:

if ($ENV{‘SERVER’} eq ‘tickets.brandx.com http://tickets.brandy.com’ )
{
$SITE_CONFIG_FILE = ‘/opt/rt3/local/etc/RT_SiteConfig_brandx.pm’ ;
} elsif ($ENV{‘SERVER’} eq ‘tickets.brandy.com http://tickets.brandy.com
) {
$SITE_CONFIG_FILE = ‘/opt/rt3/local/etc/RT_SiteConfig_brandy.pm’ ;
}

Now RT_SiteConfig:

You should have atleast 2 copies RT_SiteConfig_brandx.pm, and
RT_SiteConfig_brandy.pm each have the instance customisation ,

And thats it…

Roy

Doug Eubanks wrote:

I’m so close now…but it’s always selecting brandy (the new brand). I’m
sure it’s something small and simply that I’m missing now. I really
appreciate your help so far.

I know the whole brandx, brandy thing is a little confusing. I’ve double
checked all of the refences below, and brandx and brandy are used the
correct spots in each code snippet below.

Here is the output of the foo file that shows that the ENV variables are
being set:

tickets.brandy.com http://tickets.brandy.com <http://tickets.brandy.com

tickets.brandx.com http://tickets.brandx.com <http://tickets.brandx.com

tickets.brandy.com http://tickets.brandy.com <http://tickets.brandy.com

tickets.brandx.com http://tickets.brandx.com <http://tickets.brandx.com

tickets.brandy.com http://tickets.brandy.com <http://tickets.brandy.com

tickets.brandx.com http://tickets.brandx.com <http://tickets.brandx.com

tickets.brandy.com http://tickets.brandy.com <http://tickets.brandy.com

tickets.brandx.com http://tickets.brandx.com <http://tickets.brandx.com

tickets.brandy.com http://tickets.brandy.com <http://tickets.brandy.com

tickets.brandx.com http://tickets.brandx.com <http://tickets.brandx.com

I’ve double checked the httpd.conf file, inside of the brandy site, we
have
PerlRequire /opt/rt3/bin/webmux-brandy.pl

Inside of the brandx site, we have
PerlRequire /opt/rt3/bin/webmux.pl

Here’s my webmux.pl changes for the old brand:
#This drags in RT’s config.pm http://config.pm
BEGIN {
$ENV{‘SERVER’} = ‘tickets.brandx.com http://tickets.brandx.com <
http://tickets.brandx.com>’;
RT::LoadConfig();
if ($RT::DevelMode) { require Module::Refresh; }
}

Here’s my webmux-brandy.pl changes for the old brand:
#This drags in RT’s config.pm http://config.pm
BEGIN {
$ENV{‘SERVER’} = ‘tickets.brandy.com http://tickets.brandy.com <
http://tickets.brandy.com>’;
RT::LoadConfig();
if ($RT::DevelMode) { require Module::Refresh; }
}

This is my RT.pm LoadConfig sub, right before it stats and loads the site
config file:
my $ser = $ENV{‘SERVER’} ;
open F, “>> /tmp/foo” ;
print F “$ser \n”;
close F;

if ($ENV{‘SERVER’} eq “tickets.brandy.com http://tickets.brandy.com <
http://tickets.brandy.com>”) {
$SITE_CONFIG_FILE = ‘/opt/rt3/etc/RT_SiteConfig-Refense.pm’ ;
}
if ($ENV{‘SERVER’} eq “tickets.brandx.com http://tickets.brandx.com <
http://tickets.brandx.com>”) {
$SITE_CONFIG_FILE = ‘/opt/rt3/etc/RT_SiteConfig.pm’ ;
}

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

On Tue, Feb 24, 2009 at 9:53 AM, Raed El-Hames <rfh@vialtus.com <mailto: rfh@vialtus.com>> wrote:

Sorry Doug my mistake its been a long time since I did this:
we set :
$ENV{‘SERVER’} = 'my_brandx_instance.com
http://my_brandx_instance.com http://my_brandx_instance.com in
the relavent webmux-brandx.pl , it would n’t have existed before …
The best bet to see if its loaded into ENV is by adding a print
statement in RT.pm LoadConfig, looking at my dev code I think I
managed to do something like
sub LoadConfig {

my $ser = $ENV{‘SERVER’} ;
open F, “>> /opt/rt3/bin/foo” ;
print F “$ser \n”;
close F;

if ($ENV{‘SERVER’} eq ‘my_brandx_instance.com
http://my_brandx_instance.com http://my_brandx_instance.com’ ) {
$SITE_CONFIG_FILE =
’/opt/rt3/local/etc/RT_SiteConfig_brandx.pm’ ;
}

I think at the time of restarting apache something will be written
to the foo file

Roy

Doug Eubanks wrote:

   Here is my relevant httpd.conf sections....I've sanitized the
   hostnames......

   <VirtualHost *:80>
      CacheEnable disk /
      ServerAdmin support@brandy.com <mailto:support@brandy.com>
   <mailto:support@brandy.com <mailto:support@brandy.com>>

      DocumentRoot /opt/rt3/share/html
      ServerName tickets.brandy.com <http://tickets.brandy.com>
   <http://tickets.brandy.com>
      ServerAlias tickets.brandy.com <http://tickets.brandy.com>
   <http://tickets.brandy.com> tickets2.brandy.com
   <http://tickets2.brandy.com> <http://tickets2.brandy.com>
   ticket.brandy.com <http://ticket.brandy.com>
   <http://ticket.brandy.com> ticket2.brandy.com
   <http://ticket2.brandy.com> <http://ticket2.brandy.com>

      AddDefaultCharset UTF-8

      PerlModule Apache::DBI
      PerlRequire /opt/rt3/bin/webmux.pl

      PerlSetVar MasonStaticSource true
      PerlSetVar MasonBufferPreallocateSize 1073741824
      PerlSetVar MasonDataCacheDefaults "cache_class=>
   SharedMemoryCache, cache_de                         $
      PerlSetVar MasonPreloads '/Elements/*'
      PerlSetVar MasonCompRoot /opt/rt3

      SetHandler perl-script
      PerlHandler RT::Mason

      Alias /titan /opt/rt3/share/html

    # ScriptAlias /titan/ /opt/rt3/share/html

   </VirtualHost>

   <VirtualHost *:80>
      CacheEnable disk /
      ServerAdmin support@brandx.com <mailto:support@brandx.com>
   <mailto:support@brandx.com <mailto:support@brandx.com>>

      DocumentRoot /opt/rt3/share/html
      ServerName tickets.brandx.com <http://tickets.brandx.com>
   <http://tickets.brandx.com>
      ServerAlias tickets.brandx.com <http://tickets.brandx.com>
   <http://tickets.brandx.com> tickets2.brandx.com
   <http://tickets2.brandx.com> <http://tickets2.brandx.com>
   ticket.brandx.com <http://ticket.brandx.com>
   <http://ticket.brandx.com> ticket2.brandx.com
   <http://ticket2.brandx.com> <http://ticket2.brandx.com>

      AddDefaultCharset UTF-8

      PerlModule Apache::DBI
      PerlRequire /opt/rt3/bin/webmux.pl

      PerlSetVar MasonStaticSource true
      PerlSetVar MasonBufferPreallocateSize 1073741824
      PerlSetVar MasonDataCacheDefaults "cache_class=>
   SharedMemoryCache, cache_de                         $
      PerlSetVar MasonPreloads '/Elements/*'
      PerlSetVar MasonCompRoot /opt/rt3

      SetHandler perl-script
      PerlHandler RT::Mason

      Alias /refense /opt/rt3/share/html

    # ScriptAlias /refense/ /opt/rt3/share/html

      ErrorLog logs/error_log-tickets

   </VirtualHost>

   Sincerely,
   Doug Eubanks
   admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>


   On Tue, Feb 24, 2009 at 5:45 AM, Raed El-Hames <rfh@vialtus.com <mailto:rfh@vialtus.com> <mailto:rfh@vialtus.com <mailto:rfh@vialtus.com>>> wrote:

      Hi Doug;

      Make sure you have
      ServerName   my_brandx_instance.com
   <http://my_brandx_instance.com>
      <http://my_brandx_instance.com>
   <http://my_brandx_instance.com>

      in your virtual host conf file;

      <VirtualHost my_brandx.com:443 <http://my_brandx.com:443>
   <http://my_brandx.com:443>>
        ServerName my_brandx.com <http://my_brandx.com>
   <http://my_brandx.com>

        DocumentRoot /opt/rt3/share/html
       etc etc

       ...
      </VirtualHost>

      And remember to restart httpd ..

      Good luck;
      Roy

      Doug Eubanks wrote:

          I believe I see where you are going with this....

          My problem is that $ENV{'SERVER}, $ENV{'SERVER_NAME},
   etc are
          not being set to anything.  When I had it print all the ENV
          variables to a temp file, it only printed 4 or 5
   variables and
          they were stuff like "MOD_PERL" version, etc.

          For some reason, those environment variables are not
   set....

          Sincerely,
          Doug Eubanks
          admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>
          <mailto:admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>>



          On Mon, Feb 23, 2009 at 12:35 PM, Raed El-Hames <rfh@vialtus.com <mailto:rfh@vialtus.com> <mailto:rfh@vialtus.com <mailto:rfh@vialtus.com>> <mailto:rfh@vialtus.com <mailto:rfh@vialtus.com> <mailto:rfh@vialtus.com <mailto:rfh@vialtus.com>>>> wrote:

             Doug;

             Are you using fast cgi , or mod_perl ??, with
   fastcgi you
          can run
             as many instances you want  --sorry I don't use so I
   do n't
          have
             working apache config,
             with mod_perl you suppose to only run one instance
   due to
          how the
             mod_perl/mason work, however I did find a work
   around and
          this is
             how I got my instances working:

             for each instance (brand), I have
             RT_SiteConfig_brandx.pm (all in /opt/rt3/local/etc/ )
             webmux-brandx.pl (which is a copy of webmux.pl
   adding the line
              $ENV{'SERVER'}    = 'my_brandx_instance.com
   <http://my_brandx_instance.com>
          <http://my_brandx_instance.com>
             <http://my_brandx_instance.com>'; #at the top where the
          rest of

             $ENV is being defined

             Modify local/lib/RT.pm adding :

             if ($ENV{'SERVER'} eq 'my_brandx_instance.com
   <http://my_brandx_instance.com>
          <http://my_brandx_instance.com>
             <http://my_brandx_instance.com>' ) {

                   $SITE_CONFIG_FILE =
             '/opt/rt3/local/etc/RT_SiteConfig_brandx.pm' ;
             }elsif ($ENV{'SERVER'} eq 'my_brandy_instance.com
   <http://my_brandy_instance.com>
          <http://my_brandy_instance.com>
             <http://my_brandy_instance.com>' ) {

                   $SITE_CONFIG_FILE =
             '/opt/rt3/local/etc/RT_SiteConfig_brandy.pm' ;
             }

             You add these lines @ the top/start of sub LoadConfig

             In you httpd.conf you call the correct webmux for your
          instance:
             PerlRequire /opt/rt3/bin/webmux-brandx.pl

             Thats it, the above setup allow you to share the same RT
          directory
             , so customisation is easier,

             Hope that helps,

             Regards;
             Roy


             Doug Eubanks wrote:

                 I'm trying to setup a second instance of RT that
   has a
                 different branding, but uses the same SQL
   server, etc.

                 I copied my existing (and working) RT
   installation over
          to a
                 new directory.  Then I created the new instance in
          Apache in
                 the httpd.conf, changing the file locations to
   the new
                 directories.  Then I edited the RT_SiteConfig.pm
   file to
                 reflect the new file locations.

                 For some reason, the errors are showing up in
   the original
                 directory's logs and the error returned is:
                 [Mon Feb 23 15:47:56 2009] [warning]: [Mason] Cannot
          resolve
                 file to component:
          /opt/rt3-[NEWBRAND]/share/html/index.html
                 (is file outside component root?) at

/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm
line 853.

(/usr/lib/perl5/vendor_perl/5.8.8/HTML/Mason/ApacheHandler.pm:853)

                 The browser returns a 404 error.

                 What am I missing?  Is it not possible to run two RT
          instances
                 on the same server?

                 Sincerely,
                 Doug Eubanks
                 admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>
          <mailto:admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>>
                 <mailto:admin@dougware.net
   <mailto:admin@dougware.net> <mailto:admin@dougware.net
   <mailto:admin@dougware.net>>
          <mailto:admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>>>





             <http://www.vialtus.com/disclaimer.html>

And is RT calling the right RT_SiteConfig ??
I am guessing you have modified each RT_SiteConfig per brand??
what do you get when you restart apache and when you browse to each
instance??

Roy

Doug Eubanks wrote:

I disabled the new brand, using just the old brand (but with the script
changes we made) and it’s still using the settings for the new brand.

Something about environment variable we are setting is constantly getting
set to the new brand, no matter which brand you try to use.

I’ve had our local perl guru double check my changes and I’ve set them
according to your notes. I believe that either there is one crucial step
that we’ve overlooked, or that there is something particular about my
httpd.conf that’s not working right (PerlSetVar statements, etc).

Just as a test yesterday, I separated the log files for each name based
virtual server to make sure that we were being served from the right server
instance, and depending on which URL I used, the correct log file was
showing activity.

Sincerely,
Doug Eubanks
admin@dougware.netOn Wed, Feb 25, 2009 at 4:42 AM, Raed El-Hames rfh@vialtus.com wrote:

Morning Doug;

If you can test it, can you comment out the entry for the brand y in
httpd.conf , ie start up with just brand x and see what you get, just to
make sure your settings are correct for brand x …
Always remember to restart httpd.

Regards;
Roy

Doug Eubanks wrote:

Yes, they have different webmuxes (webmux.pl and webmux-brandy.pl).

It appears the ENV[‘SERVER’] is always matching webmux-brandy.pl, even
though the /tmp/foo file shows different entries.

Could a MasonDataCacheDefaults setting, or a mod_perl setting cause the
RT.pm to use the “first” loaded $ENV[‘SERVER’] string? I’m so confused?

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

On Tue, Feb 24, 2009 at 12:10 PM, Raed El-Hames <rfh@vialtus.com <mailto: rfh@vialtus.com>> wrote:

And is RT calling the right RT_SiteConfig ??
I am guessing you have modified each RT_SiteConfig per brand??
what do you get when you restart apache and when you browse to
each instance??

Roy

Doug Eubanks wrote:

   That's what I have, two different webmux.pl files...

   They are in the same /opt/rt3/bin folder...

   The old brand is called webmux.pl, the new brand is called
   webmux-brandy.pl

   They are called in httpd.conf with these two separate lines in
   their respective host entries...
   PerlRequire /opt/rt3/bin/webmux-brandy.pl
   PerlRequire /opt/rt3/bin/webmux.pl

   Sincerely,
   Doug Eubanks
   admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>

*Roy El-hames *

ISP Systems

Vialtus Solutions

(formerly Pipex Business)

Direct Dial: +44(0) 208 587 6181

E-mail: rfh@vialtus.com mailto:rfh@vialtus.com

Visit us on:

www.vialtus.com http://www.vialtus.com/

This email is subject to:

http://www.vialtus.com/disclaimer.html

I made a mistake…

If I comment out the new instance…restart http and try to access the old
instance by url, the old instance is shown.

So to answer your question, if I comment out brandy, brandx is displayed
properly.

Sincerely,
Doug Eubanks
admin@dougware.netOn Wed, Feb 25, 2009 at 9:41 AM, Doug Eubanks admin@dougware.net wrote:

I disabled the new brand, using just the old brand (but with the script
changes we made) and it’s still using the settings for the new brand.

Something about environment variable we are setting is constantly getting
set to the new brand, no matter which brand you try to use.

I’ve had our local perl guru double check my changes and I’ve set them
according to your notes. I believe that either there is one crucial step
that we’ve overlooked, or that there is something particular about my
httpd.conf that’s not working right (PerlSetVar statements, etc).

Just as a test yesterday, I separated the log files for each name based
virtual server to make sure that we were being served from the right server
instance, and depending on which URL I used, the correct log file was
showing activity.

Sincerely,
Doug Eubanks
admin@dougware.net

On Wed, Feb 25, 2009 at 4:42 AM, Raed El-Hames rfh@vialtus.com wrote:

Morning Doug;

If you can test it, can you comment out the entry for the brand y in
httpd.conf , ie start up with just brand x and see what you get, just to
make sure your settings are correct for brand x …
Always remember to restart httpd.

Regards;
Roy

Doug Eubanks wrote:

Yes, they have different webmuxes (webmux.pl and webmux-brandy.pl).

It appears the ENV[‘SERVER’] is always matching webmux-brandy.pl, even
though the /tmp/foo file shows different entries.

Could a MasonDataCacheDefaults setting, or a mod_perl setting cause the
RT.pm to use the “first” loaded $ENV[‘SERVER’] string? I’m so confused?

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

On Tue, Feb 24, 2009 at 12:10 PM, Raed El-Hames <rfh@vialtus.com<mailto: rfh@vialtus.com>> wrote:

And is RT calling the right RT_SiteConfig ??
I am guessing you have modified each RT_SiteConfig per brand??
what do you get when you restart apache and when you browse to
each instance??

Roy

Doug Eubanks wrote:

   That's what I have, two different webmux.pl files...

   They are in the same /opt/rt3/bin folder...

   The old brand is called webmux.pl, the new brand is called
   webmux-brandy.pl

   They are called in httpd.conf with these two separate lines in
   their respective host entries...
   PerlRequire /opt/rt3/bin/webmux-brandy.pl
   PerlRequire /opt/rt3/bin/webmux.pl

   Sincerely,
   Doug Eubanks
   admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>

*Roy El-hames *

ISP Systems

Vialtus Solutions

(formerly Pipex Business)

Direct Dial: +44(0) 208 587 6181

E-mail: rfh@vialtus.com mailto:rfh@vialtus.com

Visit us on:

www.vialtus.com http://www.vialtus.com/

This email is subject to:

http://www.vialtus.com/disclaimer.html

Should the /temp/foo file add a line each time I request a page from the
ticket system?

I seems that it only gets new lines added when I restart apache.

Sincerely,
Doug Eubanks
admin@dougware.netOn Wed, Feb 25, 2009 at 9:47 AM, Doug Eubanks admin@dougware.net wrote:

I made a mistake…

If I comment out the new instance…restart http and try to access the old
instance by url, the old instance is shown.

So to answer your question, if I comment out brandy, brandx is displayed
properly.

Sincerely,
Doug Eubanks
admin@dougware.net

On Wed, Feb 25, 2009 at 9:41 AM, Doug Eubanks admin@dougware.net wrote:

I disabled the new brand, using just the old brand (but with the script
changes we made) and it’s still using the settings for the new brand.

Something about environment variable we are setting is constantly getting
set to the new brand, no matter which brand you try to use.

I’ve had our local perl guru double check my changes and I’ve set them
according to your notes. I believe that either there is one crucial step
that we’ve overlooked, or that there is something particular about my
httpd.conf that’s not working right (PerlSetVar statements, etc).

Just as a test yesterday, I separated the log files for each name based
virtual server to make sure that we were being served from the right server
instance, and depending on which URL I used, the correct log file was
showing activity.

Sincerely,
Doug Eubanks
admin@dougware.net

On Wed, Feb 25, 2009 at 4:42 AM, Raed El-Hames rfh@vialtus.com wrote:

Morning Doug;

If you can test it, can you comment out the entry for the brand y in
httpd.conf , ie start up with just brand x and see what you get, just to
make sure your settings are correct for brand x …
Always remember to restart httpd.

Regards;
Roy

Doug Eubanks wrote:

Yes, they have different webmuxes (webmux.pl and webmux-brandy.pl).

It appears the ENV[‘SERVER’] is always matching webmux-brandy.pl, even
though the /tmp/foo file shows different entries.

Could a MasonDataCacheDefaults setting, or a mod_perl setting cause the
RT.pm to use the “first” loaded $ENV[‘SERVER’] string? I’m so confused?

Sincerely,
Doug Eubanks
admin@dougware.net mailto:admin@dougware.net

On Tue, Feb 24, 2009 at 12:10 PM, Raed El-Hames <rfh@vialtus.com<mailto: rfh@vialtus.com>> wrote:

And is RT calling the right RT_SiteConfig ??
I am guessing you have modified each RT_SiteConfig per brand??
what do you get when you restart apache and when you browse to
each instance??

Roy

Doug Eubanks wrote:

   That's what I have, two different webmux.pl files...

   They are in the same /opt/rt3/bin folder...

   The old brand is called webmux.pl, the new brand is called
   webmux-brandy.pl

   They are called in httpd.conf with these two separate lines in
   their respective host entries...
   PerlRequire /opt/rt3/bin/webmux-brandy.pl
   PerlRequire /opt/rt3/bin/webmux.pl

   Sincerely,
   Doug Eubanks
   admin@dougware.net <mailto:admin@dougware.net>
   <mailto:admin@dougware.net <mailto:admin@dougware.net>>

*Roy El-hames *

ISP Systems

Vialtus Solutions

(formerly Pipex Business)

Direct Dial: +44(0) 208 587 6181

E-mail: rfh@vialtus.com mailto:rfh@vialtus.com

Visit us on:

www.vialtus.com http://www.vialtus.com/

This email is subject to:

http://www.vialtus.com/disclaimer.html