For my own reference.
I'm having trouble finding the correct permissions for running a web site on my ubuntu machine. I'm confused whether to put 777/755 to whole directory of my site or webroot public_html
in my home folder.
my username is arehman and my webserver user is www-data
OS: Ubuntu 16.04 LTS 64-bit Apache2 php 7.1
EDIT
I have symlink to /var/html/www/project_1
and the project is in home/user/public_html/project_1
. I have given 775 to the project/uploads
folder and now files gets uploaded; but now every file is owned by www-data user:group and I can't edit the files if needed. Only way is to copy them, edit, and paste back in uploads folder.
Is there a way to make uploaded files have write access for my user?