Granting User Access to /var/www/html

2011-11-05

Probably a no-brainer for many, but I can never remember, and this seems to be best practice:

Personally, I would set the ownership of /var/www/html to apache. You can do this by:<br /> chown apache /var/www/html
Next, I would create a group of let’s say “Web admins”:<br /> groupadd webadmins
Add the user webadmin to the newly created group:<br /> usermod -G webadmins webadmin
Add group permissions to the newly created group:<br /> chmod g+rw /var/www/html

Source:

http://serverfault.com/questions/310325/how-do-i-give-a-user-access-to-var-www-html

I also had to
chgrp webadmins /var/www/html

and log out.

Written on November 5, 2011