I recently dealt with this incident while I was moving an existent install and I wanted to share how I got it to work
source: digital ocean centos 6.5 32bit
target: server: centos-6.6 64 bit-v20141218 - in google cloud
the target server was giving me the dataroot is not writable, admin has to fix directory permissions error.
so here are my ownership, permissions and also locations for the folders among other details
document root form moodle install: /var/www/html/moodlefolder/
drwxr-xr-x. 3 apache apache 4096 Jan 7 01:21 html
apache is the owner of the html folder and also everything within it.
dataroot location : /var/www/data/
drwxr-xr-x. 11 apache apache 4096 Jan 7 01:23 data
apache is the owner of the data folder.
the database was dumped from the source server and later restore onto the target server (no issues during the restore)
and the db user was created for the database with all privideleges for that database.
In the config I changed
1. the moodle install location: >$CFG->wwwroot = 'http://[new ip on gcloud instance]/moodlefolder'
2. set the data root: $CFG->dataroot = '/var/www/data';
3. the dbname, dbuser. dbpass with the same info used when creating, importing and setting the user privideleges for the db user.
reload ...and then the error went away.
my reflexion:
I think that apache being the owner of the content with the documen root and the data folder and of course the appropiate permissions was key to get it resolved, setting up the 777 or 0770 was giving the same error until I completed all the steps above
If I should tied up my permissions as per the moodle experts any recommendations are welcome.