Multiple sites, one installation

Post about your customizations to share with others.

Moderators: Developer, Contributor

cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Multiple sites, one installation

Post by cas »

@phileas,
yep feel free to beuatify, can only help the community :P
Phileas
Posts: 29
Joined: 22 Feb 2010, 16:51
Location: Switzerland

Re: Multiple sites, one installation

Post by Phileas »

cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Multiple sites, one installation

Post by cas »

Thanks, it looks much better like this :D
ryanasr
Posts: 1
Joined: 14 Feb 2011, 00:11

Re: Multiple sites, one installation

Post by ryanasr »

Agreed much better, formatting makes all the difference.
AussieSwede12
Posts: 1
Joined: 15 Feb 2011, 15:08

Re: Multiple sites, one installation

Post by AussieSwede12 »

Oh yeah!! That's neat! Thanks! :D
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Multiple sites, one installation

Post by cas »

There is one other area which needs to be addressed which is the reference within Mantis to custom_strings_inc.php.
In the current setup it is assumed that these would be the same for all instances running of that singel install. This clearly is not de facto true.
Good news is that it is not a real issue anyway :D
This can be handled pretty easily, exactly in the same way as for the base config !!
Just move your custom strings into an instance dependent file caklled custom_strings_mantis1.php and so on.
Then your custom_strings_inc.php would look like :
<?php
// ******************************************************************************************
// * *
// * HTTP_HOST is used to determine the config file needed for webservices *
// * SCRIPT_NAME is used to determine the config file needed for commandline services *
// * *
// ******************************************************************************************
$hostheader = $_SERVER['HTTP_HOST'];
$mailscript = $_SERVER['SCRIPT_NAME'];

switch ($hostheader) {
case "mantis1.yourdomainl.com" :
include('custom_strings_mantis1.php');
break;
case "mantis2.yourdomainl.com" :
include('custom_strings_mantis2.php');
break;
}

switch ($mailscript){
case "read_mail_mantis1.php" :
include('custom_strings_mantis1.php');
break;
case "read_mail_mantis2.php" :
include('custom_strings_mantis2.php');
break;
}

The same applies for the custom_constants_inc.php

@phileas,
did not add that to the wiki, did not want to screw up your very nice lay-out :lol: . So please add the above to the Howto.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Multiple sites, one installation

Post by cas »

we found a lot of error messages (type notify) in the php errorlog after this change.
The reason being that we also use the commandline feature and then clearly there is no hostheader.
In order to avoid the messages, the config_inc.php needs to be adjusted as follows :

Code: Select all

if (isset($_SERVER['HTTP_HOST'])) {
    $hostheader = $_SERVER['HTTP_HOST'];
}
Initially there was no condition given for reading of the hostheader.
Phileas
Posts: 29
Joined: 22 Feb 2010, 16:51
Location: Switzerland

Re: Multiple sites, one installation

Post by Phileas »

Hi cas

please have a look at http://www.mantisbt.org/wiki/doku.php/m ... stallation in section Examples.
can you correct the source of config_inc.php, i do not know where you made this change.
or let me know what you exactly mean, how it should be coded.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Multiple sites, one installation

Post by cas »

Phileas,
documentation adjusted. Manged to do that without damaging the lay-out :D
Post Reply