How do I give a user access to /var/www/html?

I'm new to Linux admin'ing. I created a user named webadmin and I want to give it permission to read/write in the /var/www/html directory.

How do I go about doing this?


Personally, I would set the ownership of /var/www/html to apache. You can do this by:

chown apache /var/www/html

Next, I would create a group of let's say "Web admins":

groupadd webadmins

Add the user webadmin to the newly created group:

usermod -G webadmins webadmin

Add group permissions to the newly created group:

chmod g+rw /var/www/html