I recently inherited a system and wanted to be edit all of the website files. I changed the group to admin and added myself to the group. Then I wanted to change all of the directories so I could have access to them, and change all of the file permissions so the group had read-write access and others (including Apache) had only read access. The command to do that is:
sudo chmod -R u+rwX,go+rwX,o-w .
-R recursively change
u+rwX users to read and write, and if it is a directory, also execute
go+rwX same as users for group and others
o-w then remove the write permission for others
. start here