Data directory problem on install 3.9.1

Data directory problem on install 3.9.1

by Duncan Baker -
Number of replies: 16

I am trying to install 3.9.1 using install.php through the chrome browser

The install runs OK to the first page then I get to the confirm paths page and it seems happy with the web address and the moodle directory but it does not like the data directory address. When moodle tries to make that directory I get:

Parent directory (/home/g/l/global2018) is not writeable. Data directory (/home/g/l/global2018/moodledata) cannot be created by the installer.

If I manually make a moodledata directory and insert publi_html into the data directory path, install sees the directory OK but tells me it is not secure and will not proceed.

I have also tried installing via the command line. The html sever is running PHP 7.2.3 but the CLI is running 5.5.9 so Moodle doesn't like that either.

Grateful for thoughts. TVMIA

Duncan

Average of ratings: -
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You may need to make it yourself if the installer cannot write it. However, 'public_html' is a worry. That implies that you are trying to create it in a web served area (which is often called public_html). You can put the directory any place you like *except* somewhere that the web server can "see".
In reply to Howard Miller

Re: Data directory problem on install 3.9.1

by Duncan Baker -
Thanks Howard. That is the big problem. The website is hosted on a dedicated server and I can't get above public_html using FTP.
There seem to be two command line methods outlined by Moodle. But for one, I don't have access to sudo as the ISP sees that as a security risk and for the other, the cli is running an older version of php which Moodle doesn't like.
I have spent most of the day playing email tennis with the isp - maybe time to change sad
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Moodle has two directories:

  1. The Moodle source code directory.
  2. The "Moodledata" data directory. This will contain files added by teachers and students.

I'm guessing that the Moodle source code is in /home/g/l/global2018/public_html? In which case I would create directory /home/g/l/global2018/moodledata for the data directory. You may need to allow all server users to write to this with the command chmod 0777 /home/g/l/global2018/moodledata to make it writable (some recommendations here).

I think what the installer doesn't like is if you have Moodledata either within the source code directory – or even using the same directory as the Moodle source code directory – as these files could potentially be accessed by anyone on the Internet.

In reply to Leon Stringer

Re: Data directory problem on install 3.9.1

by Duncan Baker -
Thanks Leon. Please see my reply to Howard. The problem is that I cannot create /home/g/l/global2018/moodledata and the Moodle installer doesn't seem to be able to see above public_html to do it for itself. More email ping-pong in the morning I suspect.
The isp are a lovely bunch and I have been with them for years but there are others on the market. sad
In reply to Leon Stringer

Re: Data directory problem on install 3.9.1

by Duncan Baker -
PS - I tried the .htaccess - no joy sad
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

An understanding of what Moodle expects will save blind trial-and-error trips.

1. As Leon already mentioned, the Moodle code need to be somewhere. We safely assume that it is /home/g/l/global2018/public_html. Unlike WordPress and many other programs, Moodle does not write in its code directory, i.e. it needs and should be given only read permissions to that directory.

2. Moodle asks for a separate directory to write, for example to put the uploaded files. Since that can't be the code directory or a sub-directory of it, and since you don't have permissions to anything above /home/g/l/global2018 the only possible place is /home/g/l/global2018/moodledata.

3. Moodle can not make that directory. Moodle is a process of the web server, and the web server runs as user and group different from the Unix (shell) login, you are using. It is you (your login) who needs to create that directory and then give the web server write permissions to that directory.

If you are not familiar with the basic file permissions in Unix, ask your hosting people to create moodledata and give it right permissions. Don't try to explain all this, just give them the link to this discussion and https://docs.moodle.org/39/en/Installation_quick_guide for details.

BTW, your server can't be a dedicated server - think of the meaning of its name. May be it is dedicated, but not to you. ;(
In reply to Visvanath Ratnaweera

Re: Data directory problem on install 3.9.1

by Duncan Baker -
Thanks very much Visvanath. The problem is I can't get to /home/g/l/global2018 - I can only get to /home/g/l/global2018/public_html and if I create the directory there as /home/g/l/global2018/public_html/moodledata Moodle tells me that is not secure and will not install.
But I will forward your comments to the isp and see what happens.
Again, many thanks.
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Is /home/g/l/global2018/public_html your DocumentRoot - in the sense if you put a test.html there it will be reachable in the web under http://example.com/test.html ?
In reply to Visvanath Ratnaweera

Re: Data directory problem on install 3.9.1

by Duncan Baker -
Yes indeed.
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Then you might get away with this plan:
- Moodle code in /home/g/l/global2018/public_html/something
- then your Moodle URL will be http://example.com/something
- make /home/g/l/global2018/public_html/moodledata for moodledata

The installation might warn, but you can go ahead, i believe. But not a clean solution for the long term. Yep, your friends who maintain the dedicated need to support you.
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If this is the case, you're going to really struggle to run Moodle on hosting this basic/restricted.
Average of ratings: Useful (1)
In reply to Duncan Baker

Re: Data directory problem on install 3.9.1

by Ken Task -
Picture of Particularly helpful Moodlers

Me thinks you are going to have to disclose where you host ... what provider?  And the specific lease ... thought you said dedicated ... which means you should have full control and should be able to put moodledata anywhere ... and use it ... given apache server not restricted to a 'user space' ... which your's sounds like it is.

Example: On OVH hosted servers (I don't host with them) each domain had an open_base directive.   By default it only allowed access to directory where the code resided.   But, OVH did allow user to add to the open_base to include other directories ... thus one could put moodledata in a directory up one level from public_html and into the 'user' space, add the full path to the moodledata directory in the open_base config and moodle would be happy, OVH would be happy, etc.

Your provider might have something like that ...

'SoS', Ken

In reply to Ken Task

Re: Data directory problem on install 3.9.1

by Duncan Baker -
Thanks Ken,
I am sure that's what I had with another isp back in the mists of time.
Tomorrow will tell smile
Duncan