Data directory ({$a->dataroot}) cannot be created by the installer.

Data directory ({$a->dataroot}) cannot be created by the installer.

by Mat Simon -
Number of replies: 13

Well I'm now once again at installation starting point because Ubuntu's integration with on Hyper-V either works or well... just doesn't work stable enough at the moment. So I'm switching to CentOS because MS certified its big brother RHEL 5, I hope to be safe there. Sad, because I'm really more used to Debian.

I am now a bit confused with Moodle 2 Setup now on CentOS 5 because it complains about the moodledata folder /var/moodledata I wanted to set. It's owned by the user apache (chown -R apache:apache) and even was set to 777. The folder absolutely exists but the setup complains it can't create it - WTH?! wink

Here's the message:
Data directory ({$a->dataroot}) cannot be created by the installer.
ls -la /var clearly shows:
drwxrwxrwx 2 apache apache 4096 20. Dez 22:15 moodledata
Could someon point me to the right direction? (Or do I have to do a manual config.php?)
Average of ratings: -
In reply to Mat Simon

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Patrick Curley -

I'm getting the same problem. running CentOS 4.

In reply to Patrick Curley

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Patrick Curley -

Changed permissions to 0777 and it worked OK. Changed back to 0770, hope nothing else blows up.

In reply to Patrick Curley

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by wissem Sayeh -

Hi, I'm trying to install Moodle for the first time and I'm having a lot of trouble getting it to work. I've installed the server on Ubuntu. After a lot of pain, I finally got the Moodle installation script to load on my browser. However, it is telling me that my var/www/moodle directory is not writable. See the screenshot below. I tried to log in as root nut it did not work either.As you can see the moodle web address and directory are also greyed out. Is this normal? Please help. I really want to use moodle with my students and I need to get it running before the end of the holidays. If you have a detailed tutorial with pictures (for a beginner like me) please post the link here.

In reply to wissem Sayeh

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Daan Diederiks -

Hi Wissem,

If I understand well, I seems to have the same problem. Came to the conclusion that the moodledata dir must be created in the root (/). My problem is that my provider doesn't allow the creation of dirs in this root. I am in contact with them now.

I tried to change the htaccess file according to moodle manual, but this didn't work either. Moodle indicates then that the dir is not safe enough.

Don't know a solution either. So if someone does?

Regards,

Daan

In reply to Daan Diederiks

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by wissem Sayeh -

Hi Daan,

 I solved the problem by installing an earlier version of Moodle and by deleting and creating manually some folders and files (using root privileges in Ubuntu). Now, since I'm completely new to this whole thing, I'm stuck again at how I am going to make my perfectly functional Moodle site accessible to my students on the internet. I'm completely new to servers and databases....All I succeeded to do till now is to search forums and execute a few things.

Please, help me guys! I'm so glad it's finally up and running (locally on my Ubuntu home computer). All I need to do now is to make it accessible on the internet. I read a few things but they all look complicated and beyond my modest teacher knowledge in this domain. I'd like to use my computer as the DNS provider for this website...I don't wat to pay for a commercial service. Is it possible? please post any answers here

thanks in advance for the help!

In reply to wissem Sayeh

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Benjamin Mr. -

wissem

I believe you need to give apache permission to create files. I just ran into this problem myself and this worked for me. Working as root give the following commands in a terminal:

chown -R apache:apache /var/www/moodle
chown -R apache:apache /var/moodledata
chmod ugoa=rwx /var/www/moodle
chmod ugoa=rwx /var/moodledata

Ridiculously unsecure to set permissions this way but I was lazy and didn't want to figure out which specific permissions to set. Just needed to get past the problem quickly.

In reply to Patrick Curley

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Jared Luellen -

I am using Apache and I can't figure out why I keep getting this...

Can someone help me please!

In reply to Mat Simon

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's centos's security settings. I'm not going to be much use as I don't use centos and can't remember what it's called but I'm pretty certain that's what you are looking for.
In reply to Howard Miller

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Jason Vore -

you need to run the following command from the terminal:

chcon -R -t httpd_sys_content_t /path/to/moodledata

This sets SELinux to allow apache to write to the directory.

Average of ratings: Useful (1)
In reply to Jason Vore

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Might it be more helpful under these circumstances to create the Moodle itself in a /var/www/moodle/moodle directory and the moodledata directory will then appear in the var/www/moodledata directory? Not sure what implications this has for security issues, but dropping the .htaccess file into the var/www/moodle directory might achieve the same results as if it were in the var/www directory.

Alternatively, if you were to install you moodle on a local machine, ftp it to your site manually create the moodledata directory and then edit the config.php-dist file pointing the $CFG->dataroot to the location of the moodledata directory that might work as well. The issue will then be pointing the config.php paths to the right places. This might be a little unothodox, but it should actually work, if the database is in place... Good luck.

In reply to Jason Vore

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by toni hernandez -

Thanks Jason. That worked out for me.

I had the same problem in CENTOS 5.5

In reply to toni hernandez

Re: Data directory ({$a->dataroot}) cannot be created by the installer.

by Mat Simon -

I forgot to reply and say thanks since I was busy with other stuff wink

SELinux bite me several times until I decided to disable it and re-think about it when I really need it. It didn't even allow me to connect to the Postgres server until I disabled it. (I switched to permissive mode, that was sufficient)

Average of ratings: Useful (1)