Reply New Topic
29/11/2023 13:29:43
#1
Offline
Webmaster

embryonal multi-site support

I am currently hosting several basic sites that are more or less using the same ImpressCMS setup when it comes to modules. Core versions are not so frequent, but I'm using specific flavors of the content module for example where I do regular changes, and it's a chore to update all the sites, without forgetting one here and there.

so I was thinking  why not have one build that is common for all the sites, and just make the configuration different depending on the domain name that is used to reach the server? I could see some clashes with the cache that might need to be resolved, certainly if multiple sites use the same theme, off the top of my head, but I'm fairly confident that could be fixed quickly by adding the reference to the site domain.

I'll experiment and keep this thread updated.


_________________

Me on OpenHub


2/12/2023 7:43:16
#2
Offline
Home away from home

Re: embryonal multi-site support

Keep us posted - this has been a topic that has had quite a bit of discussion and some development.

MultiX on ICMS

Zarilia + ImpressCMS = ???

I remember more things, but not sure where those discussions or development are/were


_________________
Christian Web Resources
Facebook

25/11/2024 7:27:01
#3
Offline
Webmaster

Re: embryonal multi-site support

My first approach will be very basic : one unified installation, with different configuration and database, based on domain name. Once this is working, I can contemplate more complex use-cases with module overrides and an overarching admin page to manage multiple domains.

The change

That one is quite easy to get working : I define separate instances of mainfile.php, with the domain name embedded, such as mainfile_www.domain1.com.php and mainfile_domain2.org.php. Each of those files contains a complete configuration of an ImpressCMS site. I then replace the content of mainfile.php to include the mainfile based on the server host.

This must be hardened and improved, but works well for an alpha version :

$mainfilename = "mainfile_". $SERVER[HTTP_HOST] . ".php";
include $mainfilename;

I was able to have 2 domains point to the same hosting instance, and this works great. The same ImpressCMS filebase, pointing to a different configuration file and database, based on the domain you use. There is only one fairly important part that's not working : I can't login with the domain I added. Probably a minor detail somewhere, so I'll figure it out soonish.

Improvements

At the moment there is no distinction between the different sites when it comes to storage of images, uploads and cache data. That needs to be improved as well before this can be considered beta. But all in all, with a single small change, I'm impressed that I got this far already.


_________________

Me on OpenHub


Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.