Your first command, the chown /var/www/moddle
, was syntactically bad. You had to run some other, if you didn't get back an error message.
First, try a
chown root:root /var/www/moodle
...although a chroot command should be able to be called. Probably there is also another problem, what gets you if you call a
chroot /var/www/moodle
?