I’ve checked this again. The upgrade from Moodle 5.0.2 to 5.2.1 worked for me, but Moodle now shows a new optional environment warning:
As I just figured, this is related to Moodle’s newer router, front-controller setup.
Moodle 5.1 introduced the new /public webroot, and also added routing support.
The 5.1 release notes say routing is recommended but not required, with a compatibility layer included.
That’s probably why my upgraded installation still worked, which is likely wasn’t using any feature or plugin that depends on the new router.
We are sorry about this breakage. Virtualmin now needs to handle not only the Moodle 5.1+ /public webroot, but also the router fallback configuration.
We’ll update the Moodle installer to configure this properly instead of just letting Moodle show the warning.
Meanwhile, you can fix this manually by configuring Moodle’s router fallback.
For Apache, edit the .htaccess file in Moodle’s public web directory, the public/ directory inside the Moodle install.
If Moodle is installed at the site root, add:
FallbackResource /r.php
If Moodle is installed under a subdirectory such as /moodle, add:
FallbackResource /moodle/r.php
For Nginx, add a matching location rule. For a site at the root:
location / {
try_files $uri $uri/ /r.php?$query_string;
}
For a site under /moodle:
location /moodle/ {
try_files $uri $uri/ /moodle/r.php?$query_string;
}
After the web server rule is in place, edit Moodle’s config.php and add this before the final setup include:
$CFG->routerconfigured = true;
Then reload Apache/Nginx if you changed the main web-server config, and re-check Moodle’s environment page.