How to make right permissions on web server
One of the most frequent problem is permissions.This is a headache for web developer.I have light and easy solution.I had tested it on my Debian GNU/Linux server.
cd /webfolder/ chown -R www-data:www-data . find . -type d -print0 | xargs -0 chmod 775 find . -type f -print0 | xargs -0 chmod 644
In this script we setting up permissions to folders and directories.Also we changing owner to web-server user.
I think that the simplest way.If you have more easier method you can describe it in comments.