Menu

Prove Moodle dataroot is not on the public hostname
📰

Prove Moodle dataroot is not on the public hostname

DEV Community: php·Luuk Verhoeven·about 9 hours ago
#JD0Fz1r3
#devto#dev#moodledata#moodle#dataroot
Reading 0:00
15s threshold

A Moodle™ install that looks healthy on /login/index.php can still be serving student submissions, session files and backup zips from a directory the browser can reach. The directory is $CFG->dataroot . Moodle stores uploaded files there on purpose. The web server is not supposed to.

The official check is Site administration → Reports → Security checks. That report is a start. It is not proof. The proof is a request from the public hostname that either 404s or is refused, against a file you know exists on disk.

What dataroot actually holds

On a typical production host:

/var/moodledata/filedir/ # hashed copies of every uploaded file /var/moodledata/sessions/ # PHP session files if you still use file sessions /var/moodledata/temp/ # backups, imports, unzip leftovers /var/moodledata/cache/ # MUC file store /var/moodledata/localcache/ /var/moodledata/trashdir/

Enter fullscreen mode

Exit fullscreen mode

If that tree sits under the document root — public_html/moodledata , www/data , htdocs/moodledata — a…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.