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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

multisites possible?


Go to End


107 Posts   35706 Views

Avatar
Juanitou

Community Member, 323 Posts

28 March 2010 at 2:28pm

Edited: 28/03/2010 9:57pm

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

Avatar
Juanitou

Community Member, 323 Posts

28 March 2010 at 10:08pm

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

Avatar
Juanitou

Community Member, 323 Posts

28 March 2010 at 11:28pm

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

Avatar
jorrie

Community Member, 40 Posts

29 March 2010 at 5:22am


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?

Avatar
Juanitou

Community Member, 323 Posts

29 March 2010 at 7:17am

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.

Avatar
jorrie

Community Member, 40 Posts

29 March 2010 at 7:22am

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

Avatar
Juanitou

Community Member, 323 Posts

29 March 2010 at 8:16am

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

BTW, the module googlesitemap works!

Avatar
jorrie

Community Member, 40 Posts

29 March 2010 at 8:35am

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?