How to achieve a multisite setup with multiple Joomla instances #546
-
|
Hello All, We have a client, a private University who wants to redo their current WP based website (which is a mess at the moment with poor information architecture, lot of menus, lot of duplicates content, poor page load speeds and many more issues). Requirements
Multi-sites
StructureEach of the these subdomain websites will have content as:
Our ideasWhat we thought of is having a multisite setup such as:
Is this something that can be achieved using Pages? Any help is appreciated. Thank you! Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Pages would be great option for your use-case. You setup the different sites in Pages and you render data for each through different Pages collections. Multi-siteYou can easily setup up multi-sites with Pages, either as domains, subdomains or even as sub-folders. The pages router can handle this out of the box, you tell it the location of your sties and it will load your pages from there. You only need to setup your vhosts in Apache correctly yourself. For example: <?php
return array(
'sites' => [
'[www.]?example.com/shop[*]' => JPATH_ROOT.'/sites/shop',
'[www.]?example.com[*]' => JPATH_ROOT.'/sites/site',
'intranet.example.com[*]' => JPATH_ROOT.'/sites/intranet'
],
);You can find more info on how to configure a multi-site setup in the wiki Handling multi-site contentIn your setup you would use Joomla as a hybrid CMS (another fancy buzz-word!) Using the Joomla permission system and the category system to structure your content in such a way that it's separated where you need it to be separated, for example per site. Content editors would use the Joomla backed to manage all content for all sites, permissions would define what content they have access to. In case you want to have multiple Joomla instances (backends) for different sites, this would be possible too. Right now the database collection can only connect to a single database, however, we are working on making it possible to easily connect to different databases, either on localhost on the same server or using an SSH tunnel to different servers. With that in place Joomla + Pages === Hybrid CMS (and buzz-proofed). Code for that is working and will be committed soon. Generating MenusIf the sites use the same menu structure I wouldn't use Joomla menu manager, just hard-code your menus in Pages, if you really need to you could take the menu items from the Joomla database, have a menu per site in Joomla, but you probably don't need to this to be managed by the client. You can find examples of how to handle navigation in Pages in the Agrea.ph repo Static Cache and Traffic SpikesPages 0.19 includes a static page cache. The static cache can be enabled per site and disabled per page, so you can very easily exclude pages from the static cache if needed. It turns Pages into a JIT static page generator. (since we are doing buzz-words let's invent some of our own, shall we) What I mean by this, is that Pages can generate static pages for you on the fly, and regenerate them on the fly, ... It's like having an SSG with an army of Christmas-Elves inside that cache your pages for you. When enabled the static will cache the page as a Here is a stress-test I did on our own servers, at 60 requests per second with the static cache enabled. Apache keeps humming along nicely. I can bump this to 100 requests per second and it will not budge. This is running on a 5USD/month VPS with a properly configured and optimised Apache. If you add CloudFlare on top of it you are super duper protected against any eventuality, even server outages. I have built a CloudFlare worker that is smart enough to handle the use-case where the site is down, it will return the cache. Whatever the world throws at you, Pages can handle it. Widgets (dynamic data)Pages can handle dynamic data too, dynamic just means your caching strategy is different. There are multiple layers of caching, each gives serious performance benefits, by fine-tuning them for your use case you can handle just about anything and everything. Widgets work but the means of injecting js, you can use them or you could consider the following alternative approaches:
You get a very fast and very cacheable result. ESI (edge site includes) isn't something that Pages currently automates, but something that I'm planning to put more work into, it would be a next step towards further improve caching while maintaining a level of dynamic-ness. More info: https://blog.cloudflare.com/edge-side-includes-with-cloudflare-workers/ If you have more questions please let me know. To get a better idea of how to create a site with Pages also check the Agrea.ph repo, this is a site @waseemsadiq and I built last fall, we open-sourced the code on Github as an example of how everything fits together. |
Beta Was this translation helpful? Give feedback.


Pages would be great option for your use-case. You setup the different sites in Pages and you render data for each through different Pages collections.
Multi-site
You can easily setup up multi-sites with Pages, either as domains, subdomains or even as sub-folders. The pages router can handle this out of the box, you tell it the location of your sties and it will load your pages from there. You only need to setup your vhosts in Apache correctly yourself. For example: