In any sort of web development, there are usually several good reasons to handle development differently from production. It's convenient to have a local copy of your web site in your home directory for development, but accept that it's okay for some things to not work fully until you push the changes to the production environment.
You shouldn't be trying to tie the Drupal permission scheme and your user account permission scheme together. Let the production Drupal stuff live in
/var/www/html or wherever, with all the permissions that make Apache/PHP/Drupal happy. Let your development tree be owned by you.
Whenever you finish work on a new feature for the web site, use some sort of synchronization tool to push the changes from dev to production, incidentally getting new permissions along the way.
Personally, I use
rsync for this. That has the nice advantage that the production server can be across the Internet, since tunneling
ssh is trivial. That's an important feature with web development, since there are usually good reasons to host your web site on a server not on your own LAN. I use a command like this for my sites:
rsync -lprtvD -e ssh --delete \
--exclude \*.swp \
--exclude .svn \
--exclude GNUmakefile \
./ [email protected]:/var/www/html
That command will make the files be owned by the
www user on
www.mysite.com, decoupling the dev permission scheme from production.
It sounds like you want to use SVN instead, which is fine. You just have to make it so the dev and production boxes can both see the SVN server. As with rsync, you want to be tunneling the SVN protocol through
ssh here, for security. When it's time to push a change to production, check it into SVN, then check it out on the production box. Actually, I'd recommend using
svn export instead of
svn checkout to avoid scattering
.svn subdirectories all over your web server tree. The rsync method avoids that with