Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

multi-host support


Reply

8 Posts   2693 Views

Avatar
Tkop

31 July 2007 at 10:05am 28 Posts

I noticed that _config.php sets a project variable.
In support of consolidated code does silverstripe
support multiple projects at the same time.

If so how would you configure it? If possible
I'd like to use a virtual host server to host
multiple domain-names. Normally I would
put a copy of silverstripe in each doc_home
but from the way _config.php sets the project
I'm wondering if there is a way to bypass the
multiple copies of silverstripe.

Avatar
Andy

31 July 2007 at 10:53am 230 Posts

There is current no way to do this currently (to my knowledge).

Avatar
Sam

31 July 2007 at 5:16pm Administrator, 682 Posts

The project variable lets you change the name of the 'mysite' folder to something else. In our internal development environment, we have each sites project-specific folder named differently.

If you're wanting to do code-consolidation, the best bet is to experiment with symbolic links.

* Move the sapphire, cms and jsparty folders to some common place.
* Add symlinks for them in each of your projects.

Avatar
webair

26 October 2008 at 10:54am Community Member, 8 Posts

Hi,

For developing i'm also working with symbolic links. But i got a problem with the "assets" Folder. In the Media Manager it tries to get to the folder relativ (../assets), and start looking in the common source folder for the image. finally it ends up in a fatal error, that it couldn't find the file. Is it importent that it looks for the file relativ, or could it be changed in an absolute path? Or is there a better way to fix that?

thanks,

webair

Avatar
freakout

4 November 2008 at 9:56pm Community Member, 49 Posts

Does anybody has a patch for this problem? I'm willing to run 100+ SilverStripe sites on a server and need symbolic links for space and performance (caching!) efficiency.

Avatar
Fuzz10

4 November 2008 at 11:23pm Community Member, 787 Posts

Subscribe...

Avatar
webair

16 November 2008 at 2:40am (Last edited: 16 November 2008 2:41am), Community Member, 8 Posts

Hi

I added that issue as an bug. You can find it under http://open.silverstripe.com/ticket/3074.

best regards

webair

Avatar
Nadee

18 November 2008 at 7:49pm Community Member, 12 Posts

I achieved this with sub-domains. Change your _config.php to do the following:

if (isset($_SERVER['SERVER_NAME'])) {
   $servername = $_SERVER['SERVER_NAME'];
   $domainpart = explode(".", $servername, 2);
   $database = $domainpart[0];
} else {
   die('..or you can configure to redirect to a default location.');
}

and then change the database accordingly:

global $databaseConfig;
$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "localhost",
   "username" => "username",
   "password" => "password",
   "database" => $database,
);

But the fact remains that you can't use multiple paths for the assets folder depending on the sub-domain, or at least I could not figure that out. If there is a function like Filesystem::setAssetsPath() please let me know.

Cheers.