One solution is creating a group specifically for users who should be able to create files and directories in /var/www/html.
All commands below are to be executed as root.
1. Create the group:
groupadd webbies
This will create a group called webbies. You can name it whatever you want but I find that having non-professional sounding names can help you remember what groups you have creaetd yourself and what ones came with the distribution. Not that it matters much though.
2. Change ownership of /var/www/html and subdirectories:
chown -R root.webbies /var/www/html
3. Make sure the webbies group members have write access everywhere in /var/www/html:
chmod -R g+rw /var/www/html/*
4. Finally, add yourself and anyone that should have write access there to the webbies group (or whatever you chose to call your group). Open up /etc/group and find the line that begins with webbies, like this:
After the last colon you can add a comma-separated list of users:
Code:
webbies:x:407:tommy,hw,elvis
Users don't become members until they have logged in the next time (so log out and then log in again). Type
groups to see a list of groups you are member of.
Håkan