IF the VPS is a dedicated server just to you ... you are the only client on that VPS ... you should have full run at the server. Typically, 'user space' in apache (the /home/[username]/public_html/ is restricted and not like apache's true web document root located at /var/www/html and the 'home' directory for the apache user which in CentOS 6 is 'apache' which is /var/www/
Use of the sudo command .... should NOT be using user 'nobody' in the command.
After logging onto your server as user, issue the following command:
sudo -s
(the -s means stay as root user).
You will be prompted to provide the same password for your user account access.
Your prompt will change to 'root'.
Now change into the location of the moodlecode/admin/cli/
and issue: php install.php
See if that gets by ....
Now since you are using root, all files/folders ownerships/permissions shouldn't restrict.
After finishing, check the ownership/permissions on all files/folders in /home/[username]/public_html/moodle/
There could be other tweaks needed due to /home/ user restrictions.
In all honesty, with CentOS 6, think you'd be better off sudo -s and use /var/www/html/ for the location of the git acquired moodle code and /var/www/ for the location of moodledata directory - that's *IF* your VPS is set up that way.
Something else about CentOS 6 ... in 2020 (which is only 2 years away) CentOS 6 will no longer be getting OS updates. For future/longer use might check into CentOS 7
https://wiki.centos.org/About/Product
Because there is no OS upgrade directly in CentOS 6 to CentOS 7 ... it means a new instance.
'spirit of sharing', Ken