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.

General Questions /

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

multisites possible?


Go to End
Reply


107 Posts   19394 Views

Avatar
otherjohn

Community Member, 125 Posts

6 May 2010 at 7:11am

Is there any update to this if using 2.4 r2?
I am considering this for my clients and possibly the following setup.

All admin done via one domain "myclientadmin.com"
I think I can program the ability to redirect a client to the "myclientadmin.com" if they try to come into admin via "myclient1.com/admin"
All images and files are hosted on Amazon s3 so that probably would mean not changing the image file.
But how do I handle different modules for different clients?

Any suggestions where to start here?
john

Avatar
m3d

Community Member, 8 Posts

23 July 2010 at 10:43pm

created folder and copied files, created symlink as suggested from Juanitou. Now I stuck with the BASE_PATH. Where do I have to correct it? And what is it supposed to say?

Have an "application"-folder "silverstripe" in the root of my testserver with subfolder cms and sapphire. have a "website"-folder ss_one for the first site (will have folder ss_two etc. for other websites) and in this I have the symlinks to cms and sapphire and subfolder assets, mysite and themes.

when I try to open the site I get the error:

$project isn't set in /Applications/XAMPP/xamppfiles/htdocs/silverstripe/sapphire/core/ManifestBuilder.php on line 259

and I see the typical error site, with "Cannot modify header information...".

Does this error come from the information BASE_path or is there another problem? Thanks for any help :-)

bye - nina

Avatar
UncleCheese

Forum Moderator, 4096 Posts

24 July 2010 at 2:04am

It's a little different in 2.4. The BASE_PATH constant is not calculated the same way. The fix is to create an index.php file in your site root:

<?php

define('BASE_PATH', dirname(__FILE__));
include ('sapphire/main.php');

?>

And update your .htaccess file to point to that instead of sapphire/main.php.

Avatar
banal

Community Member, 901 Posts

24 July 2010 at 5:45am

There's a better way. Use [url=http://doc.silverstripe.org/environment-management]_ss_environment.php[/url] to your advantage.

In your SilverStripe 2.4 base folder, create a file called _ss_environment.php and put the following line in it:

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

Of course you are free to also add DB information that all your installations share, as described on the doc page above.

Then simply put the following line into mysite/config.php

require_once('conf/ConfigureFromEnv.php');

That's all. Works a charm here... here's how my file-structure of a typical site looks like:

BaseInstall2.4.1 (silverstripe codebase)
   +- sapphire
   +- cms
   +- googlesitemaps
   +- dataobject_manager
   +- swfupload
   +- _ss_environment.php (as described above)
SomeSite (all website folders are structured like this)
   +- sapphire (symlinked to BaseInstall2.4.1/sapphire)
   +- cms (symlinked to BaseInstall2.4.1/cms)
   +- googlesitemaps (symlinked to BaseInstall2.4.1/googlesitemaps)
   +- dataobject_manager (symlinked to BaseInstall2.4.1/dataobject_manager)
   +- swfupload (symlinked to BaseInstall2.4.1/swfupload)
   +- assets own asset folder for each site
   +- mysite own mysite folder for each site
      +- _config.php as described above

So all websites are structured like SomeSite and have only a custom assets and mysite folder, but otherwise share the same codebase.

Avatar
UncleCheese

Forum Moderator, 4096 Posts

24 July 2010 at 6:44am

Banal's right.. that's the pro way to do it.

Avatar
m3d

Community Member, 8 Posts

24 July 2010 at 6:51am

Great! Thanks a lot - I will try that!

Avatar
dospuntocero

Community Member, 54 Posts

24 July 2010 at 7:07am

what about uploading stuff? i remembered last time i made that, when the editor uploaded a file sapphire started with the problems..

Avatar
banal

Community Member, 901 Posts

24 July 2010 at 7:50am

@dospuntocero: Uploading should work fine. Never had problems with it (I always use a separate assets folder for each install and set it's permission bits to 0777).

Go to Top