[solved] multi-site install

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
hedgomatic
New Member
New Member
Posts: 8
Joined: Wed Apr 09, 2008 2:09 pm

[solved] multi-site install

Post by hedgomatic »

(question about multi-site installs, blah blah blah)
Last edited by hedgomatic on Tue Apr 15, 2008 8:26 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: successful multi-site install, except...customize templates_c directory?

Post by calguy1000 »

multisites is  not supported

if you have nearly 70 subdomains working you should know what your doing without having to ask for help.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
alby

Re: successful multi-site install, except...customize templates_c directory?

Post by alby »

hedgomatic wrote: is there any way to override this in the config? I've disabled caching via the admin for every one of the sites including the "master" one, and it still seems to cache.
At minimum you must hack fileloc.php also!

Alby
hedgomatic
New Member
New Member
Posts: 8
Joined: Wed Apr 09, 2008 2:09 pm

Re: successful multi-site install, except...customize templates_c directory?

Post by hedgomatic »

thanks Alby  :]
hedgomatic
New Member
New Member
Posts: 8
Joined: Wed Apr 09, 2008 2:09 pm

Re: [solved] multi-site install

Post by hedgomatic »

i had to modify things slightly. Here's what I now have for anyone who's interested...the lovely bit about this method is that the modules install globally off a single install, and the user only has to click the install link via the admin pannel to enable it for their site.

config.php:

$siteNames = Array(anchorage,atlanta,chicago,cincinnati,cleveland,etc,etc,etc);
$currentPath = explode('.',$_SERVER['HTTP_HOST']);
$successKey = array_search($currentPath[0],$siteNames);

if($successKey) {
$successName = $siteNames[$successKey];
$config['db_prefix'] = $successName.'_'; 
        $config['root_url'] = 'http://'.$_SERVER['HTTP_HOST']; 
        $config['root_path'] = "/home/aaum/public_html/master";     
        $config['previews_path'] = '/home/site/public_html/master/sites/'.$successName.'/tmp/cache';
        $config['uploads_path'] = '/home/site/public_html/master/sites/'.$successName.'/uploads';
        $config['uploads_url'] = 'http://domain.com/master/sites/'.$successName.'/uploads';
        $config['admin_dir'] = 'admin';
        $config['image_uploads_path'] = '/home/site/public_html/master/sites/'.$successName.'/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/sites/'.$successName.'/uploads/images';

} else {   
$config['db_prefix'] = 'a1_master_';
        $config['root_url'] = 'http://domain.com/master'; 
        $config['root_path'] = '/home/site/public_html/master';
        $config['previews_path'] = '/home/site/public_html/master/tmp/cache';
        $config['uploads_path'] = '/home/site/public_html/master/uploads';
        $config['uploads_url'] = $config['root_url'] . '/uploads';
        $config['admin_dir'] = 'admin';
        $config['image_uploads_path'] = '/home/site/public_html/master/uploads/images';
        $config['image_uploads_url'] = $config['root_url'] . '/uploads/images';
}



The directory structure basically looks like:


/master
-----admin
-----cgi-bin
-----doc
-----images
-----include (we keep our templates in here)
-----lib
-----modules
-----plugins
-----sites (contains cache and upload directories for each domain)
----------anchorage
---------------tmp
--------------------cache
--------------------templates
--------------------templaces_c
---------------uploads
----------atlanta
---------------etc
----------etc
-----tmp (cache for default page. I'm using this to display a 404)
-----uploads (presumably if we ever wanted global content available to all domains...)


I then also edited filloc.php (thanks again Alby) to set the upload directory to use this schema, similar to the config file.


I then set up subdomains for every site, and redirects like so:

http://subdomain.domain.com/uploads/ -> public_html/master/sites/subdomain/uploads

to handle content that already existed for the sites we had.

I also had to upgrade them, which was a snap. I had the current version running in /master already, so then just
set config.php to writeable, login to the first subdomain, which prompts me to upgrade the db schema, because it sees the one config has set it to is old.

after completing the schema upgrade, drag the config back over the one that upgrade has newly written. log in to the next site, which will prompt you to do the schema upgrade again.

rinse and repeat for each subdomain and yer done.


we're using several modules, including Album, which work fine using this method so far as my testing's gone.
Last edited by hedgomatic on Tue Apr 15, 2008 8:27 pm, edited 1 time in total.
alby

Re: [solved] multi-site install

Post by alby »

hedgomatic wrote: we're using several modules, including Album, which work fine using this method so far as my testing's gone.
You can to have problem with modules "files dependant" for example: FileBackup, MysqlDump (I think), ...
They create a folder in admin.
These directories must be configurable in uploads or (better) in a protected directory under site structure.

Alby
hedgomatic
New Member
New Member
Posts: 8
Joined: Wed Apr 09, 2008 2:09 pm

Re: [solved] multi-site install

Post by hedgomatic »

alby wrote:
hedgomatic wrote: we're using several modules, including Album, which work fine using this method so far as my testing's gone.
You can to have problem with modules "files dependant" for example: FileBackup, MysqlDump (I think), ...
They create a folder in admin.
These directories must be configurable in uploads or (better) in a protected directory under site structure.

Alby
We're in a situation where we would probably audit any module requests in a staging area before making it available, but it certainly gives pause.
Post Reply

Return to “CMSMS Core”