I have apache2 with php FPM setup and guest have ownership
I’ve enabled webdav of some folders for a client. When connected and upload files and folders they get created.
So when I do mkdir() I have 2770 for the bit when creating folders, this way webdav running as apache will create files and folders under the owner group, and www-data as user.
My problem is I can’t get www-data user to create these folders as 770 so this way in my web app, the php user running as the owner can write/delete to the folder. It is witting permissions as drwxr-sr-x
When searching online I only get you must change the umask and I’ve tried all sort of strings in vim /etc/php/8.4/fpm/pool.d/thispool.conf and I just can’t get it working.
Does anyone have any experience on changing umask to have www-data chmod permissions to 770?
And you’re not done, as @ID10T mentioned, this is still subject to the parent, so ensure you create parent with gidbit php mkdir(location,02770) so that apache creates with inherited group w good permissions, and how virtualmin sets up www-data is that it adds the owners group to www-data.
This also does not seem to affect virtualmin when creating folders