Jump to:

23372 Posts in 18170 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » multisites possible?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Go to End
Author Topic: 17557 Views
  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: multisites possible? Link to this post

    Hi!

    The list provided by Tim missed, if I’m not wrong, that you have to move the root folder files for installation, so:

    1. Copy the silverstripe files to a master silverstripe directory; ex. "silverstripe232"
    2. Don't install it (perhaps thats ok too?)
    3. Copy assets, mysite, themes folders and the files in the root (notably .htaccess) to another directory; ex. "mysymlinkedsite"
    4. Set the correct rights to these folders (777)
    5. Create symlinks to the shared folders (saphhire, cms, etc.) (HOWTO)
    6. Create a "silverstripe-cache" folder in your "mysymlinkedsite" (777 again)
    7. Proceed with the installation as normal (by visiting e.g. localhost/mysymlinkedsite)
    8. Enjoy...

    This process did not work for me at first time, since ManifestBuilder complained. To make the story short, I had to explicitly define BASE_PATH in line 121 of sapphire/core/Core.php, as pointed by Sam (it also works by defining $baseDir in ManifestBuilder then, if you want to get templates, setting Director::setBaseFolder() in _config.php).

    EDIT: Needless to say, you lose the possibility to have multisites by hard-coding the BASE_PATH. I have still to find a solution.
    EDIT2: BASE_PATH is defined in Core.php based on the location of this file, so multisites cannot work. If we could use instead something as Director::setBaseFolder() in _config.php… How others did manage to have multisites without hacking further the code?

    I have yet to test modules. For the time being, CMS works (including assets!), but calling sitemap.xml (the other module being installed by default is googlesitemaps) gives an error: Call to undefined method ContentNegotiator::disable(). Well, that’s another story!

    Hope it helps,
    Juan

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: multisites possible? Link to this post

    As all this is somewhat over my head, I’ve created an enhancement ticket: http://open.silverstripe.org/ticket/5290

    Don’t hesitate to correct me if all this is nonsense!

    Thanks,
    Juan

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: multisites possible? Link to this post

    SOLVED: Reverted Core.php to r97728. Only those two lines modified:
    define('BASE_PATH', rtrim(dirname(dirname($_SERVER['SCRIPT_FILENAME'])), DIRECTORY_SEPARATOR));
    define('BASE_URL', rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), DIRECTORY_SEPARATOR));

    Hope it helps,
    Juan

  • jorrie
    Avatar
    Community Member
    40 Posts

    Re: multisites possible? Link to this post

    So Guys is this rock solid?

    I have to set this up but not sure what to follow ( the last post above here i mean the first before this post with instructions work ) ?
    Anyone can share some light on this and how to achieve this? with the instructions provided above and if it really works?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: multisites possible? Link to this post

    Rock solid… let’s not exaggerate! ;-)

    I’m testing it right now (BTW I forgot to indicate that I’m working in 2.4b2, this explaining the needed changes in Core.php, I think). Two default sites, without modules, are working. I’d prefer to not touch to the core, though.

    I’ll report later if I find something more to contribute.

  • jorrie
    Avatar
    Community Member
    40 Posts

    Re: multisites possible? Link to this post

    Hi Ive also just upgraded to the 2.4 beta 2..
    If I understand I have to modify the core files or are those modified in this beta 2.4 version 2 ?
    Thanks again

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: multisites possible? Link to this post

    You have to modify Core.php, or at least I had to do it.

    BTW, the module googlesitemap works!

  • jorrie
    Avatar
    Community Member
    40 Posts

    Re: multisites possible? Link to this post

    Could we request support for this out of the box?

    So I modify the core.php like this: ?

    define('BASE_PATH', rtrim(dirname(dirname($_SERVER['SCRIPT_FILENAME'])), DIRECTORY_SEPARATOR));
    define('BASE_URL', rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), DIRECTORY_SEPARATOR));

    what line numbers is that?

    17557 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
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.