Having most frustrating problem with permissions installing plug ins

Having most frustrating problem with permissions installing plug ins

by Kathy Cee -
Number of replies: 2

I am using Moodle 3.4 on a virtual machine. 

Whenever I try to install a plug in of any kind at all, I get a message that my permissions are not set to write for the web user. 

If I go to Administration->Plugins and Install plug ins and select the plug in type from the drop down list, I get Plugin type location /var/www/html/moodle/theme is not writable

If I try to drop a zip file of a theme or anything else in there and install it I get 

Moodle local

Install plugin from ZIP file

Debugging output enabled
Validating theme_moove ... Error
  [OK] Name of the plugin to be installed [moove]  
  [OK] Plugin version [2017121200] 
  [OK] Required Moodle version [2017102500] 
  [OK] Full component name [theme_moove] 
  [OK] Declared maturity level [MATURITY_STABLE]  
  [OK] Plugin release [2.1.0] 
  [Debug] Found language file [theme_moove] 
  [Error] Write access check [/var/www/html/moodle/theme] 
Installation aborted due to validation failure
If I try and do it over the web I get 

There is a request to install plugin Moove (theme_moove) version 2017121200 from the Moodle plugins directory on this site. However, the location /var/www/html/moodle/themeis not writable. You need to give write access for the web server user to the location, then press the continue button to repeat the check.

I am using an Oracle VM VirtualBox, an apache server 2.4.6 (Cent0S) with Mysql Ver 15.1 Distrib 5.5.56-MariaDB for Linux

I have searched for a solution to this problem and cannot find one. Currently every single folder in my install has had the permissions modified to 0777 and ownership changed to apache:apache (which seems to be the user and group for this install) and nothing. It has achieved absolutely nothing. As far as the web based moodle is concerned, there is no ability to write to those wide open folders. 

Am I missing something? Is there something in a config file somewhere that needs to be changed? I've already checked everything I can find - directorywritepermissions=0777 etc but no matter how correct the permissions seem to be, it just won't accept that the permissions for these folders are 0777. 

Has anyone come across this before? I really want to install things through the web interface, not do everything through a terminal. 


Average of ratings: -
In reply to Kathy Cee

Re: Having most frustrating problem with permissions installing plug ins

by Kathy Cee -

Found out that this was a setting in selinux that had to be changed. 

In reply to Kathy Cee

Re: Having most frustrating problem with permissions installing plug ins

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kathy,
TNX for sharing the root cause!

For Community ref: at least Moodle dataroot should be writable but if you like to manage plug-ins install&update even from the web interface you should add some write permissions in some of the folders of the web root.
A good reference - at least, an excellent starting point - for SELinux IMHO is: http://blog.mrverrall.co.uk/2015/10/moodle-on-centos-and-red-hat-7.html

HTH,
Matteo

Average of ratings: Useful (2)