silverstripe - file permissions for assets folder
Asked Answered
B

2

5

it happens often that an silverstripe installation does not have the right permission to write in the assets folder - e.g. for saving resampled images...

I wonder what is the best permissions setting for the files and folders in assets/ to solve that problem. you read so many different things when you google...

can I just chmod the whole assets folder and its contents to 0777? or do files and folders need different permissions? is there an recommendation for Owner and Group? can I have "dangerous" settings?

Besmirch answered 8/5, 2013 at 11:16 Comment(0)
O
8

Rule of thumb:

  • Stuff the webserver needs to write (assets/, silverstripe-cache/) need to be writable by the server
  • Stuff the webserver needs to read (framework, cms, modules, custom code,...) should only be readable by the server

chmod 777 will work for the writeable parts, but you might want to set the folder's owner to the webserver's user (www-data, nobody, or whatever this is on your system) plus chmod 755 to avoid global write permissions.

Onofredo answered 8/5, 2013 at 12:24 Comment(3)
777 may be unnecessary on a production server if the right owner is set. Having 755 would be enough allowing the owner full permissions and any other type of user just read and execute permissions.Grammalogue
still not sure about the permissions. i did now chmod 755 and chown www-data. now ftp users can´t upload anymore to the assets folder. but that is important. thxBesmirch
i changed the user (chown) to a ftp user that i created via parallels plesk (ubuntu). the group is set now to www-data, which happened obviously automatically by setting the user. when logging in as another ftp user, then all assets folder contents show the user name of the logged in user as the Owner. works for me.Besmirch
B
0

See if your hosting provider will install the mod_suphp (suPHP) Apache module, then you don't have to worry about setting dangerous folder permissions: http://www.suphp.org/Home.html

Bocanegra answered 9/5, 2013 at 0:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.