Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » multi-host support

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

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

Page: 1
Go to End
Author Topic: 2626 Views
  • Tkop
    Avatar
    28 Posts

    multi-host support Link to this post

    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.

  • Andy
    Avatar
    230 Posts

    Re: multi-host support Link to this post

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

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: multi-host support Link to this post

    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.

  • webair
    Avatar
    Community Member
    8 Posts

    Re: multi-host support Link to this post

    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

  • freakout
    Avatar
    Community Member
    49 Posts

    Re: multi-host support Link to this post

    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.

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: multi-host support Link to this post

    Subscribe...

  • webair
    Avatar
    Community Member
    8 Posts

    Re: multi-host support Link to this post

    Hi

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

    best regards

    webair

  • Nadee
    Avatar
    Community Member
    12 Posts

    Re: multi-host support Link to this post

    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.

    2626 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.