This question already has an answer here:

I have figured out the base of the problem, but I have no idea how to fix it. I have a user configured named files, which has write permissions to /var/www/html/files/ and can write and read fine to it. However, when uploading a file, my apache server gets a 403 forbidden error upon viewing it. To fix it, I have to SSH into my server and chown the directory to the www-data user to see the file. Obviously, I don't want to do this every time I upload an image, since this is very frequently. How to fix?

marked as duplicate by pa4080, Community May 25 '18 at 17:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Have you tried creating a group and adding www-data to it, then grant write privileges for the folder to the group (775 or something similar)?

Not the answer you're looking for? Browse other questions tagged or ask your own question.