When uploading files via a webform, the files are then owned by the Apache process (www-data:www-data on Ubuntu, for example).
We want users to have a public_html directory. The problem is that any files uploaded via web processes can no longer be edited / managed by that user.
How can I force the ownership of files uploaded via web forms to always be user:www-data where user is the linux user of course.
I noticed in /etc/apache2/envvar there are two lines I can configure these lines:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
Is this where the resulting ownership is coming from after a file is uploaded? Is there something I can put for APACHE_RUN_USER that will default to the user that's usually found /home/(user) ?
Or is there better way to handle this?