20
7
I am running a cakephp webapp on Linode LAMP. I am finding that my temp files are created with root:root ownership. But the webapp is running with Apache's permissions (www-data). This causes warnings any time there is a new file created because it is not writable for user www-data.
How do I change the default ownership to www-data on any new files created in the temp folder?
Thanks for your help!
What about sub-directories? – mcont – 2014-12-23T21:07:47.537
Appending the -R flag to chown and chmod makes that command recursive. So the commands below will assign default group ownership to <dir> as well as all subdirectories of <dir>:
sudo chown -R :www-data <dir>
andsudo chmod -R g+s <dir>
– Josh Wieder – 2015-08-02T14:04:13.803