Supporting multi-tenancy via a centralized code base
The principal idea of this multi-tenancy approach is to have a single code base but multiple separate and standalone Moodle instances.
An example where this kind of model is suitable is where each tenant represents a school or college in the region, and each school or college has its own Moodle admin, theme, and administration settings for managing users, courses, privacy, and grades.
The following diagram illustrates this federated approach:
Figure 20.5 – Multi-tenancy via a centralised code base
This solution requires two main configuration steps:
- Web server configuration:
For each Moodle instance, a separate virtual host is required where the ServerName
, ErrorLog
, and CustomLog
parameters point to the individual instances (tenants), but the DocumentRoot
variable must be identical in all virtual hosts, ensuring that the same code base (CFG->dirroot
) is used. A virtual host...