Upgrade error - 2.9 -> 3.1 (Centos 6.6)

Upgrade error - 2.9 -> 3.1 (Centos 6.6)

by Wes Matchett -
Number of replies: 2

I am trying to disable maintenance mode after moving the moodle update into place and setting file permissions as stated in the upgrade guide using:

chown -R apache:apache moodle 
chmod -R 755 moodle

I get the following apache 403 error:

You don't have permission to access /moodle/admin/settings.php on this server.

The permissions looks correct:

ls -l moodle/admin/settings.php
-rwxrwxr-x. 1 apache apache 5262 Jul  7 04:20 moodle/admin/settings.php

so I took a look at the error log:

[Mon Jul 11 08:37:14 2016] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.6.23 configured -- resuming normal operations
[Mon Jul 11 09:00:06 2016] [error] [client 10.139.16.6] (13)Permission denied: access to /moodle/lib/editor/atto/autosave-ajax.php denied, referer: http://dunsel.baaccess.net/moodle/admin/settings.php
[Mon Jul 11 09:00:06 2016] [error] [client 10.139.16.6] (13)Permission denied: access to /moodle/admin/settings.php denied, referer: http://dunsel.baaccess.net/moodle/admin/settings.php

First it looked for autosave-ajax.php, but this file doesn't even exist.  When I try to reload settings.php the permission error for that file repeats.

How do I get the upgrade to complete?


Average of ratings: -
In reply to Wes Matchett

Re: Upgrade error - 2.9 -> 3.1 (Centos 6.6)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If anything weird happens on CentOS the first thing I do is to try disabling SeLinux - if nothing else to see if it makes a difference. 

This suggests that you have installed Moodle at /moodle which I'm guessing SeLinux might not like by default. For example, see http://www.serverlab.ca/tutorials/linux/web-servers-linux/configuring-selinux-policies-for-apache-web-servers/

In reply to Howard Miller

Re: Upgrade error - 2.9 -> 3.1 (Centos 6.6)

by Wes Matchett -
SMH - thanks. I totally skipped checking SeLinux.  I ran restorecon -Rv /var/www/html/moodle and everything is fine - the upgrade is running.

Thanks again.

For those who are searcing for how to set the SeLinux context for apache when running Moodle in a Centos (Redhat) environment, here are the commands.  I run these after doing an install.  Only need to run once and then just run the restorecon command I listed above for each moodle area.  The directories must be changed if you installed to a different location.


semanage fcontext -a -t httpd_sys_content_t '/var/moodledata(/.*)?'

semanage fcontext -a -t httpd_sys_content_t '/var/www/html/moodle(/.*)?'


Average of ratings: Useful (1)