8

Possible Duplicate:
How to avoid using sudo when working in /var/www?

Permissions mystify me. I'm worried about compromising the security of my folder, too, since it's public.

Jonathan
  • 7,470

1 Answers1

16

To give only your user permission to /var/www. You want to change the group owner to your primary group. If your username is joe this is how you would do it.

sudo chgrp joe /var/www

You then need to chmod the directory so its writable by the group joe.

sudo chmod 775 /var/www

after that you can write to /var/www

If you want to be able to edit and delete existing files. You need to take ownership of them.

sudo chown -R joe /var/www/*
strings
  • 1,394