General developer forum

still not loving "moodledata"

 
Picture of Mat Gr
still not loving "moodledata"
 

Guys i need help!

I installed Moodle 3.3 on my Apache2 server running php5. The problem is: somehow it's just working to create the "moodledate" directory (where moodle stores some user files etc.) in "/home/[myusername]/tmp/". If i configure the config.php $CFG->dataroot  = '/home/[myusername]/moodledata'; and move the directory out of the tmp folder, but it's just not working.

"Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting."

I'm pretty sure it's not about file-permissions. Maybe it has to do with the php.INI settings... I'm not an expert.

Still loving Python :D

 
Average of ratings: -
Picture of Marcus Green
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

The chances are that the directory does not exist or it is not accessible due to permissions issue and it probably isn't to do with php.ini settings.  Are you on a Unix style system or Windows?. If it is windows it needs to be in the form c:\\bla\\bla. Very few people love moodledata smile

 
Average of ratings: Useful (1)
Picture of Mat Gr
Re: still not loving "moodledata"
 

Thanks for helping me. smile

moodle is running on a server with Debian 8.9 / with Vesta. Just tried to edit the basedir.tpl and basedir.stpl templates in /usr/local/vesta/data/templates/web/apache2 But adding another directory to php_admin_value ... doesn't change a thing. 

I think it has to do with basedir because moodle is just running fine with having the moodledata in %home%/%user%/tmp but i just don't want it to save the data into a temp folder. It would be nice to have the data stored one folder upper public_html...


 
Average of ratings: -
Picture of Marcus Green
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

It won't allow it to be saved within public_html (but you are not trying that).  Check who owns the folders, i.e. ls -l 

and check for the folders having owner of group of  www-data:www-data  and permissions of chmod 777 (though that might be too much permission)

 
Average of ratings: Useful (1)
Picture of Richard Oelmann
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

I'm not familiar with Vesta - or then with the basedir files you mention, but I run Ubuntu (on servers and Mint on my localhost development laptop) and have never had a Moodle install default to putting the moodledata in a /home partition.

It has always added it as below (where html is the publicly accessible web root ie public_html on some systems)

/var/www/moodledata                  - data folder

/var/www/html/moodle                - app folder


I know on some other systems it can be (where www is the publicly accessible web root)

/var/moodledata

/var/www/moodle

I would imagine that the issue is one of permissions on the home folder - that's certainly what I would check first. You need to have www-root (or whatever your apache user is) with read/write permissions on the folder and if those have been set up for /home/yourname/temp/moodledata they will not necessarily have been maintained if you move the folder to /home/yourname/moodledata, so you may have to reset those folder permissions.

Personally though, I would move the moodledata out of /home and into /var at an appropriate level ie one above your public_html. Then confirm all the permissions are correct and ensure $CFG->dataroot is pointing to the new location properly.


Hope that helps

Richard

 
Average of ratings: Useful (2)
Picture of Marcus Green
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

When we were feeling a bit cosmopolitan and international in the 1970's

Online Discount Shop UK, Buy discounted Health and Beauty ...

 
Average of ratings: Useful (3)
Picture of Richard Oelmann
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

LOL, I'd been thinking more along the lines of

Swan vesta

 
Average of ratings: Useful (1)
Picture of Richard Oelmann
Re: still not loving "moodledata"
Core developersParticularly helpful MoodlersPlugin developersTesters

and yes - that should have been www-data not www-root as per Marcus' original comment!

 
Average of ratings: Useful (1)
Picture of Mat Gr
Re: still not loving "moodledata"
 

Guys, thank you for all the input!! IT'S WORKING!!!

The solution was to edit the vesta-templates of basedir.

1. First we copied the moodledata to  /home/[myusername]/web/[mydomainname]/moodledata

2. Then we changed the path in the config.php in the main moodle folder

3. Then we changed the basedir.tpl and basedir.stpl templates in /usr/local/vesta/data/templates/web/apache2

ORIGNAL:
php_admin_value open_basedir %docroot%:%home%/%user%/tmp

EDITED:
php_admin_value open_basedir %docroot%:%home%/%user%/tmp:%home%/%user%/web/%domain%/moodledata/

Now everything is fine. If you have the same problem be sure that you select the right template for the user in VESTA, in my case it is the "basedir" template. You canb also copy those files to create a new template.

Thanks a lot to all little helpers and the funny pictures!! :D


 
Average of ratings: -