### Invalid permissions detected in $CFG->dataroot directory, administrator has to fix permissions. Invalid permissions detected in$CFG->dataroot directory, administrator has to fix permissions.

I recently migrated a moodle instance from one box to another.  To do this I stood up a new box, installed php, mysql and apache.  I then backed up the database, on the old box, and migrated the database, and files across to the new box.  I then configured moodle.  I am getting the "Invalid permissions detected in $CFG->dataroot directory, administrator has to fix permissions." when an admin successfully logs in. I also am getting the same error when I try to browse a list of uesr. The content is there, and I can watch the videos. I can even create new users, and it seems fine. I have played with changing the group from root to apache. The permissions have been set wide open. Does anybody have any suggestions. Tony Wallace Average of ratings: - Re: Invalid permissions detected in$CFG->dataroot directory, administrator has to fix permissions.

I find I have to put the following permissions in

sudochown -R root:apache /data/moodledata/{cache,filedir,lang,temp}

sudochmod -R g+rw,o-rwx /data/moodledata/{cache,filedir,lang,temp}

Average of ratings: Useful (1)
Re: Invalid permissions detected in $CFG->dataroot directory, administrator has to fix permissions. Thanks, I applied this, and at first it didn't seem to solve the problem. In fact, I couldn't even get the default page to come up. However, I did change the permissions back to wide open, and moodle self applied an update. The update seemed to fix the error problem. However, not being satisfied with leaving the permissions wide open, I reapplied the permissions that you suggested, and every thing is fine. Thanks Tony Wallace Average of ratings: - Re: Invalid permissions detected in$CFG->dataroot directory, administrator has to fix permissions.
The procedure is documented in the wiki: http://docs.moodle.org/en/Moodle_migration.

You didn't mention the Linux distribution. The instructions for the command line are here: http://docs.moodle.org/en/Installing_Moodle#Command_line_installer.

Average of ratings: -
Re: Invalid permissions detected in $CFG->dataroot directory, administrator has to fix permissions. The distribution is centos. Tony Average of ratings: - Re: Invalid permissions detected in$CFG->dataroot directory, administrator has to fix permissions.
There are a couple of possible combinations. You may take the one as documented in Moodle Docs http://docs.moodle.org/en/CentOS_Linux_installation#Configuring_file_structure.

Average of ratings: Useful (1)
Re: Invalid permissions detected in $CFG->dataroot directory, administrator has to fix permissions. I did not know about that document Thanks! Tony Wallace Average of ratings: - Re: Invalid permissions detected in$CFG->dataroot directory, administrator has to fix permissions.

Solved!!!!

I can't quite specifiy exactly what solved the problem, but this is what I did, and the issue seems to be cleared up.

I went back to the server today, and I changed the group and owner , and permissions on the data directory as Peter Suggested.  I went to the web browser, and all I got what a blank screen.  So I went back and changed the permissions wide open on the data directory (0777).  I went back to the web browser, and refreshed, and Moodle was updating it'self.  I finished the update, and the error seems to be fixed.

Not being satisfied with leaving the permissions as 777, I went back to the server, and applied the permissions that Peter suggested again.  Moodle still seems to be working.

While I haven't completely studied the document that Visvanath suggested (http://docs.moodle.org/24/en/CentOS_Linux_installation#Configuring_file_structure), it appears that the settings are addressed in a section there.  However these settings appear to be a little more open that the ones suggested by Peter.  We will see if this appears to be a problem or not.

Thank you very much for your help.

Tony Wallace

Average of ratings: -
Re: Invalid permissions detected in \$CFG->dataroot directory, administrator has to fix permissions.
Since you have a working version now, if you want, you can start tightning the permissions. Here is the target for paranoids: http://docs.moodle.org/en/Security_recommendations#Running_Moodle_on_a_dedicated_server.

Average of ratings: -