Multisite with elgg 1.5rc

I start working on multisite on elgg 1.5rc

You can see it running on the demo site

The points are :

- multisite is not compatible with simple cache, that mean that you have to disable simple cache. I made a trac about that, but the elgg team answer is that the multisite is not yet fully yet supported so adapting simple cache is an ehancement and not a defect to solve.  I fully understand that point of view as multicite is very new. I guess that the elgg 2.0 will be fully multisite so we wont have to hack the code to make it work. So for now, no simple cache until someone brings up a hack for that :)

- The river is still not multisite comptatible as you get river data from other sites mixed into the river of the site you are logged in. The solution is to add a site_guid field in the system_log table and to modify the river so that the site_guid is checked when retrieving log data. I already made that work, ill put it in the documentation of the group soon.

- i do my best to make the new multisite plugin the more out of the core as possible to avoid hacking. Unitl now (except the river pb) i succeeded :) i override or hook the actions that need to be, and keep it inside the plugin instead of hacking  the original files

- Unfortunately, the site switching cannot be hook in a plugin. the sites_init function has a plugin_hook implemented but the hook is triggered before the plugin are loaded :) . The solution i have found is to add a multisite.php file in the engine/lib folder. This way, the siote_init hook can be registered before it is triggered by the sites_init function.

- Unfortunately, le messages standard plugin doesnt fully use the page_handler. The result is that i cannot override the pages that i would need to (the send page ...). So i am going to build a specific multisite message plugin, whhich will be a copy of the original one for most of the functions, but will be compatible with multisite. So the administrators will just have to disable the standar message plugin and enable the multisite compatible one. This is the last work i have to do before releasing a new version comptable with elgg 1.5

  • Multisite is something I am quite keen to get working moving on into the future, and it is a shame we didn't quite get it ready for 1.5.

    There are a number of issues that need to be resolved - many have already been reported on track. It would be useful to hear about your experiences and issues you ran in to in implementing your plugin.

  • This is really interesting stuff. I am definately interested in what you are doing and putting it to the test.

  • ok the multisite for elgg 1.5 is done :)

    You can see it running on the demo site

    I just wait for the offical release of elgg 1.5 to release the plugin

    @Marcus : Glad to see you in that group. As you said, i have already made some track tickets about this work. I plan to make a full memo about that and post it to the track as soon as the elgg 1.5 is released. I would be great if a full multisite readiness would be implemented in the elgg 2.0 :). Of course i am ready to share this with the elgg team

     

  • Hi Fabrice,

    I have checked your demo site and I should say it seem completely the thing that I was looking for. So I decided to test on my server.

    I just installed the plugin to my 1.5 test site as explained in the readme.txt . Before installing I just add the *.mydomain.com alias to my apache conf and added *.mydomain --> mydomainIP resolution to dns. Now when I try to enter 123.mydomain.com it is resolving to mydomain.com. Then I installed the plugin , initialized it, and created demo1 community with url demo1.mydomain.com . When I write that address to my browser i see the main elgg installation that I have done while the address is demo1.mydomain.com . I think there is no problem with this. But when I try to login with the username and password of the user who have created the community it shows a red warning token ismatch , and I am logged in and redirected back to the mydomain.com .

    What I am doing wrong?

  • Zooz :

    You miss the elgg functionnality to switch to the good site when you logg in. This was done with a hack in site.php in the function sites_init. This hack still work in 1.5, you can get it in the hack-list that you get with the plugin.

    you can also do it that way (this is what i do in the multisite version for elgg 1.5) :

    - create a file multisite.php

    - write this inside :

    <?php
    function multisites_init($event, $object_type, $object) {
                 global $CONFIG;
                register_plugin_hook('siteid','system','multisite_switch_site',500);
                return true;
            }
           
     // Register event handlers - dont change the priority value
            register_elgg_event_handler('boot','system','multisites_init',1);

    function multisite_switch_site($hook_name, $entity_type, $return_value, $parameters) {
            global $CONFIG;
            $localsite = get_site_by_url("http://" . $_SERVER['SERVER_NAME']."/");
                $sid = $localsite->guid;
                  return $sid;
            }
    ?>

    - Include the file multisite.php in the engine/lib folder

    Then elgg will switch to the good site :)

    See my next post to have some news about multisite and 1.5

    let me know if it works !!!

     

     

  • I have good and bad news about multisite and Elgg 1.5

    - The good new is that i manage to make the simple cache working with multisite. This is a good point for the performances. Now the simple cache split the cache files and create and manage different ones for each site.

    - The bad new is that i worked with elgg 1.5RC, and i get new problems with theme mixing with Elgg 1.5RC2 ..... I tried to point what has been changed in the cache management between 1.5RC and 1.5RC2 but i couldn't find out until now.  Any clue from the elgg crew (or anyone else that has an idea about it !) would be appréciate and time saving :)

  • How to only administrators make a multisite?

  • Hi Fabrice,

    RC1 had an over-ride variable that forced simplecache to stay on regardless of the admin setting.

    RC2 commented the over-ride out so that the admin setting now works as intended.

    So far as I know, that's the only difference.

  • I just want to add my support for this project as I find it very exiting but I don't really have anything I can contribute as it is all over my head Just to say there are a lot of people following this project and Thanks for all your work