APACHE PERMISSIONS

Standard

APACHE run with this profile
user = www-data
group = www-data

these are some permission changes useful to avoid problems in accessing the web server directories

OWNERSHIP
set the owner/group of the web root (/var/www) and any directories therein
# sudo chown -R www-data:www-data /var/www

PERMISSIONS FOR USERS AND GROUPS
no-one, eccept www-data user, can access the web root
# chmod go -rwx /var/www
go means”group” and “other”

allow users of the same group and other to access /var/www (not recursively)
# chmod go +x /var/www

change all directories and files in the web root to the same group (www-data)
# chgrp -R www-data /var/www

only the user can access web content
# chmod -R go -rwx /var/www

anyone in the same group can ready/write and execute directories/files in the web root
# chmod -R g +rx /var/www

give group write permissions as well, for users which need to modify content
# chmod -R g +rwx /var/www