WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • My Multi-Site solution
  • Print
Pages: [1]   Go Down

Author Topic: My Multi-Site solution  (Read 10961 times)

psmith

  • Guest
My Multi-Site solution
« on: March 02, 2010, 05:27:28 AM »
I just wanted to share with everyone the solution I've put together which allows me to run multiple WB sites off of a single codebase. It requires SSH access.

1. Install your core copy of WB.  In my case, I installed it to /public_html/wb/
2. (Optional) Customize your core site settings as you want it to be setup as a starting point for all of your other sites.
3. Using phpMyAdmin or any other mySql administation tool, export a copy of your WB database.
4. Create a new database (and new database username) and import the core database you just exported.
5. Copy the following set of core files over to your new site directory. In my case, I copied these files over to /public_html/site/.

Code: [Select]
/media
/pages
/temp
/templates
/config.php
/index.php
/upgrade-scrpt.php
/.htaccess.txt

6. Update config.php in your new site directory to match the new database name and password you just created.
7. Using SSH, login to your server account and create symbolic links to the remaining directories:

Code: [Select]
/account
/admin
/framework
/include
/languages
/modules
/search

This is an example of the SSH command you would use for each directory while inside the /public_html/site directory :

Code: [Select]
ln -s ../wb/account ./account

8. Open config.php in the core installation folder and replace that code with the following:

Code: [Select]
$pattern = '/[\/]/';

$root = trim(dirname(__FILE__), '/wb');

$url = $_SERVER['PHP_SELF'];
$b = preg_split($pattern, $url);

require('/'.$root.'/'.$b[1].'/config.php');

And that's all there is to it.  I don't know if this is a great solution or not - maybe it's just quick and dirty - but it works!

It's important to note that this solution allows every site to have its own media, pages, and templates directory. Droplets and Modules are installed at a global level. SO, if you install a calendar module to the core site at the initial installation, every child site you make after that point will also have access to the SAME calendar module.

If you install a module to the core site AFTER you make a child site, each child site will have to have its database updated as well in order to make use of the new module.

This setup should theoretically work in any directory structure, as long as your symbolic links point to the right place.

I would appreciate any feedback from you if you have suggestions for improving this setup.

Regards,
Phil
Logged

Offline Steven

  • Posts: 68
  • Gender: Male
Re: My Multi-Site solution
« Reply #1 on: August 21, 2012, 02:37:12 PM »
Hi Phil,


Looking good! However my hoster doesn't allow SSH access for security reasons. Is there another way to achieve this? With htaccess perhaps?

Regards,

Steven
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • My Multi-Site solution
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2