by john Simpson.
The latest server is ubuntu 14.04LTS. The latest moodle is 2.8
Would it help with these step by step instructions? https://docs.moodle.org/28/en/Step-by-step_Install_Guide_for_Ubuntu
The command from the above linked step by step instructions states :
sudo chown -R www-data /var/moodledata