dataroot directory problem

dataroot directory problem

by Ahmed Ibrahim -
Number of replies: 3

I am trying to install moodle and I need to put moodledata on server A and install moodle on other server B

I did a directory named dataroot on server A and installed virtual host to be accessed through http://A.A.A.A/moodledata and I accesses it through google chrome and gave permissions to apache to read/write on it

I stared installing moodle on Server B but when I asked to put the dataroot directory, I put it http://A.A.A.A/moodledata but I received an error message Data directory (http://A.A.A.A/moodledata ) cannot be created by the installer

I changed the dataroot directory by deleting http so that it is now A.A.A.A/moodledata and it is accepted but when I finished I received an error  $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

and when I trying to install moodle again, I receive the same error without allowing me to complete the installation

What do you suggest?

I am trying to install Moodle 3.5.3 on centos7

Thanks and best regards


Average of ratings: -
In reply to Ahmed Ibrahim

Re: dataroot directory problem

by Ken Task -
Picture of Particularly helpful Moodlers

The dataroot is a file system.

Brief explanation ...

Install the moodle on server and at first give it a local (same machine) path to the data root ... in CentOS 7 that could be /var/www/moodledata

The 'lions share' of storage will be filedir in moodledata.

Now the tricky part ... create a mount point on the moodle server that mounts a remote file system with plenty of space available for moodledata/filedir.

There's all sorts of kinds/ways ... so take a gander at:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/sect-using_the_mount_command-mounting

If you are remotely hosted, on systems that offer options for mounted devices, check out the hosting providers docs for that.   Example: Rackspace.   Real example (although slightly altered as not to share too much info):

[root@server ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      158G   35G  117G  23% / - this is where the moodlecode and databases reside ... moodledata here too see *filedir
srv          1.0P     0  1.0P   0% /mnt/gbucket - a Google Bucket ... which I use for backups.
/dev/xvdb        99G   60M   94G   1% /mnt/data - *filedir is a directory in /mnt/data/ for one of the moodles on this server.

The reason for the mount point only for filedir?    The other directories in moodledata, such as sessions and the caches are best/fastest if they  are on the same server as the code/web service.

OR ... one could setup the mount point in advance and test read/write to it first, then. rather then doing a web based install of moodle, copy config-dist.php to config.php then edit manually config.php where you can give the mount point path in advance of the installation.   Install via command line moodlecode/admin/cli/install.php - which excludes the apache/nginx or whatever web service you've set the server - just php and db server talking then.

Some notes on moodledata worth a read:

https://docs.moodle.org/35/en/Installing_Moodle#Create_the_.28moodledata.29_data_directory

'spirit of sharing', Ken



In reply to Ken Task

Re: dataroot directory problem

by Ahmed Ibrahim -

I tried this and wrote the path but I received the above error

How can I check that moodledata directory on IP Address A is accessed through IP Address B? How can I check that?

In reply to Ahmed Ibrahim

Re: dataroot directory problem

by Ken Task -
Picture of Particularly helpful Moodlers

The remote file systems have to be tested for access via command line.  On CentOS 7 remember that it will be the 'apache' user that needs access in Moodle.

Testing example ... just one ...

Example: have moodledata on server A that has a mount point for filedir which resides on server B.

To test from command line, sudo as apache user and copy a file to filedir.   Then remove that file.

sudo -u apache cp somefile /path/to/mountpoint/filedir/

Then

sudo -u apache rm /path/to/mountpoint/filedir/somefile

apache user has to have the ability to read and write so filedir has liberal permissions on the remote system - rwx.

If that works, then moodle code should be able to work.

'spirit of sharing', Ken