Jump to:

22999 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Hosting multiple SilverStripe installations on 1 server

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
Go to End
Author Topic: 1789 Views
  • andy_steel
    Avatar
    Community Member
    31 Posts

    Hosting multiple SilverStripe installations on 1 server Link to this post

    Since we shall be hosting multiple SilverStripe sites on 1 server, it makes sense to move all common SilverStripe files to a single location.

    Has anybody done this? How did you do it?

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    I have done this by creating symlinks to all the folders that are needed. The only problem with this, is that each installation will need a separate temp folder, either by defining TEMP_FOLDER in a site specific _ss_environment.php file, or by creating a silverstripe-cache folder in each site root. This is because the manifest uses absolute paths, and the absolute path for all the sapphire, cms, jsparty and any linked module would be the same, thus causing conflicts.

    You may also need to set Apache up to follow symlinks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    And by all means, update your File.php, Folder.php and GD.php to not use the relative path "/assets".. major problems when you SS install lives above the web root.

    I host about 15 SS sites on one shared install in /var/ss... works great. All you need is a mysite and assets folder in each vhost.

  • andy_steel
    Avatar
    Community Member
    31 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    Just found another thread about the same topic:

    Re: multisites possible?
    http://www.silverstripe.org/general-questions/show/251650#post251650

    UncleCheese, you mentioned you have a script to automatically set-up a new SS site? Can you post the code?

    How did you update File.php, Folder.php and GD.php? Did you use the site's physical path?

    If I add a silverstripe-cache folder in the virtual host root, will it be automatically detected and used?

  • andy_steel
    Avatar
    Community Member
    31 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    The problem with the symlinks solution is that it won't work on Windows. That's a real pain since we don't want extra steps after checking out code from subversion. I suppose we'll have to find a work-around for that.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    Without symlinks it's going to be tricky to do what you're asking. It would be possible, but very difficult, and would require a pretty deep understanding of the core application.

    Here's a brief sketch of how to do it:

    Let's assume that your site live at c:\inetpub\wwwroot and the silverstripe common files are in c:\inetpub\sscommon

    * The manifest builder is going to be amended to index the content of both c:\inetpub\wwwroot and c:\inetpub\sscommon
    * Requests for assets that are downloaded directly from the silverstripe common archive are going to need to . This could be done with a rewrite rule that looked to see if the file exists in c:\inetpub\sscommon, and if so, serves that file instead.
    * Your base rewriting rule, normally sends everything to sapphire/main.php, will need to be amended to instead send everything to a custom crafted index.php. This index.php will need to manipulate the $_SERVER variables and configure the manifest builder appropriately.
    * Most significantly, you would need to review all of the code for direct file access - references to file_exists, fopen, file_get_contents, etc - and change them to be able to deal with the fact that some files are in one folder and some are in another.

    To be frank, this isn't an approach that I recommend you take. A much easier approach would be to make a simple script that copied the silverstripe common files from one place into each of your sites.

  • andy_steel
    Avatar
    Community Member
    31 Posts

    Re: Hosting multiple SilverStripe installations on 1 server Link to this post

    Thanks for the reply Sam.

    I see that a lot of work would be envolved in modifying SilverStripe. I think we'll go with your suggestion and make a script to copy the common files.

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