16.04 - Setting permissions for /var/www/mysite? - Ask Ubuntu


this question has answer here:

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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User