I try to install moodle, but I encounter an error in the process when I specify the path to the moodle data folder. Mostly they want it to be in a place where it cannot be accessed from the Internet.
I tried placing it in /var/moodledata
, which gives me an error saying Parent directory (/var) is not writeable. Data directory (/var/moodledata) cannot be created by the installer.
Parent directory (/var) is not writeable. Data directory (/var/moodledata) cannot be created by the installer.
and with /var/www/moodledata
, which gives me an error saying Dataroot location is not secure
I tried granting sudo (permissions) to the /var/www/
folder and also tried to hack install.php
to skip checking by commenting out the following lines
/*while(is_dataroot_insecure()) { $parrent = dirname($CFG->dataroot); $i++; if ($parrent == '/' or $parrent == '.' or preg_match('/^[az]:\\\?$/i', $parrent) or ($i > 100)) { $CFG->dataroot = ''; //can not find secure location for dataroot break; } $CFG->dataroot = dirname($parrent).'/moodledata'; }*/
and
/* do { if ($CFG->dataroot !== '') { $prompt = get_string('clitypevaluedefault', 'admin', $CFG->dataroot); } else { $prompt = get_string('clitypevalue', 'admin'); } echo $error; $CFG->dataroot = cli_input($prompt, $CFG->dataroot); if ($CFG->dataroot === '') { $error = get_string('cliincorrectvalueretry', 'admin')."\n"; } else if (is_dataroot_insecure()) { $CFG->dataroot = ''; $error = get_string('pathsunsecuredataroot', 'install')."\n"; } else { if (install_init_dataroot($CFG->dataroot, $CFG->directorypermissions)) { $error = ''; } else { $a = (object)array('dataroot' => $CFG->dataroot); $error = get_string('pathserrcreatedataroot', 'install', $a)."\n"; cli_error(get_string('pathsunsecuredataroot', 'install')); } } } while ($error !== '');*/ } /*else { if (is_dataroot_insecure()) { } if (!install_init_dataroot($CFG->dataroot, $CFG->directorypermissions)) { $a = (object)array('dataroot' => $CFG->dataroot); cli_error(get_string('pathserrcreatedataroot', 'install', $a)); } }*/
However, I had no success. Any idea on how I can do this would be greatly appreciated!
source share