Editing text files from the command line is made easier with TextMate with it's command line extension mate
OR Sublime text2 with command line extensions. However the built in nano
text editor is easy to use as well.
Some guidance gleaned form from coolestguyplanettech.com
sudo chmod -R o+w /Library/WebServer/Documents