I am running a Moodle 2.4.8 (Build: 20140113) on a Debian Squeeze box, with Apache 2.2. Whenever a user (even the admin user) makes changes to certain settings (i.e. adding a user), or just accessing certain courses (in this case, Math 9), the page pops up with a 503 error, Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting.
Checking my /config.php
file, I see the path is set to /var/moodledata2
, which is owned by www-data www-data
, and permissions are lined up with the Moodle documentation.
This was intermittent at the start of the week, but now it's getting to be constant. There is lots of free space available (as shown below):
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 83G 37G 42G 48% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
udev 2.0G 224K 2.0G 1% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/md1 939M 35M 857M 4% /boot
/dev/md3 822G 355G 426G 46% /var
/dev/md4 917G 72G 799G 9% /var/moodledata2
# cat config.php
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle2';
$CFG->dbuser = 'root';
$CFG->dbpass = '<removed>';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);
$CFG->wwwroot = 'http://example.com/moodle2'; // <removed>
$CFG->dataroot = '/var/moodledata2';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
$CFG->passwordsaltmain = '<removed>';
require_once(dirname(__FILE__) . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
#
I'm at a loss for what to do. Permissions seem logical in how they should be (www-data owning everything, and having full access to the /var/moodledata2
folder). What is my next step?
/var/moodledata2
directory? I did achmod -R 777 /var/moodledata2
, so that should have got everything. I'll doublecheck though. Looks correct to me, in all the subfolders – Canadian Luke May 7 '14 at 17:10