I'm using Debian Wheezy. I've installed apache, php, mysql, the works. It works properly but for permissions that I need to set.
so I have my sites in /var/www/mysite
, and I'm struggling between the permissions I should leave for apache and for my normal user. I want apache to be able to create/access files and folders, and I also need my normal user to be able to update, edit, create files and folders.
I've tried these combinations:
chown -R www-data:www-data mysite/
but that doesnt let my user do anything on the files
chown -R www-data:user mysite/
somethings wrong too
chown -R user:www-data mysite/
wrong too
Right now I have this setting:
chown -R user:user mysite/
but then on stuff newly created by apache, my browser cant load these assets and the server returns an error 403
Would be glad for some help
Thanks
Best Answer
I think the best way to do this is to do use your first option:
But then add your user to the www-data group
and then give the group control over the files
Chmod 770 basically means both the user who owns the file (in this case www-data) can do read-write-execute and all users in the group assigned to the file (in this case www-data as well) can do read-write-execute.