Here’s a quick way to allow a normal user write access to the /var/www directory so that they can work with web server files without the need to login as root first. Open the terminal and issue the commands:
sudo chown -R `id --user` /var/www/ sudo chgrp -R `id --user` /var/www/
If you don’t have sudo enabled on your distro, remove ‘sudo’ from the commands and login as root first before executing them with ‘su’.
You should now be able to write to all the files within /var/www/. My only other suggestion is that you can be a bit more selective about what directories and files are allowed write access by removing the recursive option “-R” from the command.