16.04 - Setting permissions for /var/www/mysite? - Ask Ubuntu
this question has answer here:
- how avoid using sudo when working in /var/www? 8 answers
- default permissions /var/www 3 answers
after looking around site, it's been said it's best practice use 644 permission websites in /var/www.
so have done chmod 644 /var/www/mysite
i no longer have access mysite folder, permission denied. after asking this question seems need allow user execute permissions.
i've done feel in bit of mess.
so please explain best practice when comes setting permissions /var/www/mysite?
i want myuser able go in there. sort of access should www-data have? permissions should set folder , sub folders each user?
use 644 permission websites in /var/www.
no. nobody said this.
- "use "600" "644" permission websites in /var/www" for files.
- you use "700" "755" directories (what want depends on usecase).
these 2 commands fix permissions:
find /var/www/ -type d -print0 | xargs -0 chmod 755 find /var/www/ -type f -print0 | xargs -0 chmod 644
the first sets directories 755. seconds sets files 644.
permissions come in 3 groups: owner, group , others. if edit files 1 user use "700" , "600". disallow group , others access files. "750" , "650" allows access group.
Comments
Post a Comment