Page 1 of 1

[solved] multi-site install

Posted: Fri Apr 11, 2008 8:34 pm
by hedgomatic
(question about multi-site installs, blah blah blah)

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

Posted: Fri Apr 11, 2008 9:07 pm
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.

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

Posted: Sat Apr 12, 2008 8:35 am
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

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

Posted: Mon Apr 14, 2008 12:52 pm
by hedgomatic
thanks Alby  :]

Re: [solved] multi-site install

Posted: Tue Apr 15, 2008 8:25 pm
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.

Re: [solved] multi-site install

Posted: Wed Apr 16, 2008 6:45 am
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

Re: [solved] multi-site install

Posted: Wed Apr 16, 2008 3:00 pm
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.