Permission Denied / Theme Upload

Permission Denied / Theme Upload

by Robert Lightburn -
Number of replies: 1

Hello. We're new to Moodle. We just set up 1.9.10 at Bitnami Cloud. We would simply like to upload a new theme. We've accessed the directory using FileZilla but when we drag the new theme to the online theme directory, we get a series of error messages - that is to say FileZilla tries to upload each component and then returns an error a message for each. There are two  error messages for each: permission denied and folder does not exist. We contacted Bitnami and they rightly point out that the permissions for the online folder seem OK: 755.

Rather frustrated at not being able to get started with this very basic task! So any help very, very much appreciated. 

Average of ratings: -
In reply to Robert Lightburn

Re: Permission Denied / Theme Upload

by Alex Walker -

There are two aspects to Linux permissions: one is the permission levels themselves (755 in your case), and the other is the user and group associated with those permissions.

Your permissions are 755. This means that only the user who owns the 'theme' folder can upload to it. Which user owns that folder? Is it the user you're using to FTP the files, or is it Apache's own user (depending on the distro, it could be wwwuser, apache, www_data)

I don't use FileZilla (I use Transmit for FTP), but somewhere in the file or folder's properties, you should be able to see the user that owns that folder. If it's not the username you're using to connect, that's why you can't write.

If this is your problem, your best bet is to add the Apache user and your FTP user to a group, set that group to own the folder, and set permissions to 775.

The cowboy fix is to set the folder to 777, upload the files, and then change it back to 755. You must remember to set the permissions back. Leaving anything set to '777', especially the theme folder, means that any security issues in Moodle will leave your site vulnerable to people maliciously changing code. We've seen it happen.