Jump to:

23364 Posts in 18125 Topics by 2862 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: 17507 Views
  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: multisites possible? Link to this post

    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

  • m3d
    Avatar
    Community Member
    8 Posts

    Re: multisites possible? Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: multisites possible? Link to this post

    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.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: multisites possible? Link to this post

    There's a better way. Use _ss_environment.php 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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: multisites possible? Link to this post

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

  • m3d
    Avatar
    Community Member
    8 Posts

    Re: multisites possible? Link to this post

    Great! Thanks a lot - I will try that!

  • dospuntocero
    Avatar
    Community Member
    54 Posts

    Re: multisites possible? Link to this post

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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: multisites possible? Link to this post

    @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).

    17507 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.