I continue making test on my server to make things works but I'm stuck against this problem.
I have added a new group "webserver", then assigned the group to users involved "ec2-user" and "apache". After this I set up my /var/www folder with the following commands:
//own the folder
sudo chown -R ec2-user:webserver /var/www
//change folder permissions
sudo chmod 2755 /var/www
//find all directory and set permission (also new directory)
find /var/www -type d -exec sudo chmod 2755 {} +
//find all files and set permission (also new files)
sudo find /var/www -type f -exec chmod 0664 {} +
//open storage and cache folder
sudo chmod -R ug+rwx storage bootstrap/cache
at this point I should be right for everything.. but.. I upload a new file in the public folder and the file has:
-rw-r--r-- 1 apache webserver 12080306 Dec 21 21:48 eXU7Ul6v1m6968WvmApCJ383p1riz0SxxcHsLfYI.qt
the file is owned by apache, with the group webserver but the permissions are 0644, closed for groups and others...
That's =( ..what's wrong? Thanks