[rt-users] Second Instance Of RT (for branding purposes)
Doug Eubanks
admin at dougware.net
Tue Feb 24 11:05:28 EST 2009
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 at dougware.net
On Tue, Feb 24, 2009 at 9:53 AM, Raed El-Hames <rfh at 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 at brandy.com <mailto:support at 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>
>>
>> <VirtualHost *:80>
>> CacheEnable disk /
>> ServerAdmin support at brandx.com <mailto:support at 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
>>
>> </VirtualHost>
>>
>> Sincerely,
>> Doug Eubanks
>> admin at dougware.net <mailto:admin at dougware.net>
>>
>>
>> On Tue, Feb 24, 2009 at 5:45 AM, Raed El-Hames <rfh at vialtus.com <mailto:
>> rfh at 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
>>
>> ...
>> </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 at dougware.net <mailto:admin at dougware.net>
>> <mailto:admin at dougware.net <mailto:admin at dougware.net>>
>>
>>
>>
>> On Mon, Feb 23, 2009 at 12:35 PM, Raed El-Hames
>> <rfh at vialtus.com <mailto:rfh at vialtus.com>
>> <mailto:rfh at vialtus.com <mailto:rfh at 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 at dougware.net <mailto:admin at dougware.net>
>> <mailto:admin at dougware.net <mailto:admin at dougware.net>>
>> <mailto:admin at dougware.net <mailto:admin at dougware.net>
>> <mailto:admin at dougware.net <mailto:admin at 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 at vialtus.com <mailto:rfh at vialtus.com>
>> <mailto:rfh at vialtus.com <mailto:rfh at 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 at vialtus.com <mailto:rfh at vialtus.com>
>
>
>
> Visit us on:
>
> www.vialtus.com <http://www.vialtus.com/>
>
>
>
> This email is subject to:
>
> http://www.vialtus.com/disclaimer.html
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090224/05446825/attachment.htm>
More information about the rt-users
mailing list