Page 2 of 2

Re: Multiple sites, one installation

Posted: 11 Feb 2011, 07:10
by cas
@phileas,
yep feel free to beuatify, can only help the community :P

Re: Multiple sites, one installation

Posted: 11 Feb 2011, 09:38
by Phileas

Re: Multiple sites, one installation

Posted: 11 Feb 2011, 10:44
by cas
Thanks, it looks much better like this :D

Re: Multiple sites, one installation

Posted: 14 Feb 2011, 22:49
by ryanasr
Agreed much better, formatting makes all the difference.

Re: Multiple sites, one installation

Posted: 15 Feb 2011, 15:13
by AussieSwede12
Oh yeah!! That's neat! Thanks! :D

Re: Multiple sites, one installation

Posted: 17 Feb 2011, 11:18
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.

Re: Multiple sites, one installation

Posted: 02 Mar 2011, 13:56
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.

Re: Multiple sites, one installation

Posted: 03 Mar 2011, 09:49
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.

Re: Multiple sites, one installation

Posted: 03 Mar 2011, 10:15
by cas
Phileas,
documentation adjusted. Manged to do that without damaging the lay-out :D