by Mark Pearson.
Sounds like an ownership issue rather than permissions. Make sure that the moodledata folder and all subdirectories are owned by the Apache process. The command line would be something like :
sudo chown -R <user>:www moodledata
where 'www' is the group which includes the Apache web server and <user> is the user account you logged in with. -R applies the ownership recursively. Use 'sudo' because you're not doing all of this as root are you.
If you do this, then similarly,
sudo chmod -R 770 moodledata
should also work and be more secure (relatively speaking).
Mark