moodledata folder location

moodledata folder location

by Gavin McKay -
Number of replies: 11

Hi (another moodle newbee!!)
Sorry but I can see that this topic has been raised several times!
I understand that when I install moodle that the moodledata folder should be located outside the publically available area. However in all the help I've found it relates to the public_html and www folders.
When I go into the CPanel with my hosting company (or ftp) I only see a '/' root folder and then the subfolders that I add. At the moment I have moodle located at '/moodle' and moodledata at '/moodle/moodledata'.
'/moodle' is accessed via "http://vle.somedomain.co.uk" and works fine but I'm sure the location of moodledata is wrong so where should it be? I can setup protected directories with the CPanel. Is this something I should be using?

Thanks for any advise

Average of ratings: -
In reply to Gavin McKay

Re: moodledata folder location

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

> I understand that when I install moodle that the moodledata folder should be located outside the publically available area.

Outside the directory tree which Apache calls DocumentRoot http://httpd.apache.org/docs/2.2/en/mod/core.html#documentroot.

> When I go into the CPanel with my hosting company (or ftp) I only see a '/' root folder and then the subfolders that I add.

I don't know Cpanel but there is a note in the Moodle Docs http://docs.moodle.org/20/en/Creating_Moodle_site_data_directory#CPanel_and_webhosts.

> At the moment I have moodle located at '/moodle' and moodledata at '/moodle/moodledata'.

Definitely not the right place. It is odd that you could install Moodle at all.

> '/moodle' is accessed via "http://vle.somedomain.co.uk"

Then /moodle is your DocumentRoot.

> and works fine but I'm sure the location of moodledata is wrong so where should it be?

I would say /moodledata is the right place.

> I can setup protected directories with the CPanel. Is this something I should be using?

See the note from Moodle Docs linked above.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: moodledata folder location

by Hubert Chathi -

> I understand that when I install moodle that the moodledata folder should be located outside the publically available area.

Outside the directory tree which Apache calls DocumentRoot http://httpd.apache.org/docs/2.2/en/mod/core.html#documentroot.

Actually, what he said is more or less correct.  Depending on the configuration, some directories outside DocumentRoot may be publicly accessible (http://httpd.apache.org/docs/2.2/en/urlmapping.html#page-header), and in theory it is possible to make some directories inside DocumentRoot not publicly accessible.

In reply to Hubert Chathi

Re: moodledata folder location

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> Actually, what he said is more or less correct. Depending on the configuration, some directories outside DocumentRoot may be publicly accessible (http://httpd.apache.org/docs/2.2/en/urlmapping.html#page-header),

There are ways of opening directories outside the DocumentRoot to the web. But we are discussing about the moodledata directory resp. about _closing_ it to all web access other than the route taken by Moodle scripts.

> and in theory it is possible to make some directories inside DocumentRoot not publicly accessible.

Do you mean file (directory) permissions of Unix? Try putting moodledata under moodle and protecting it through file permissions. LOL
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: moodledata folder location

by Hubert Chathi -

There are ways of opening directories outside the DocumentRoot to the web. But we are discussing about the moodledata directory resp. about _closing_ it to all web access other than the route taken by Moodle scripts.

Yes, I know, but in order to close a directory to web access, you need to make sure that it isn't web accessible.  Just saying to put it outside of DocumentRoot isn't enough -- it has to be outside of an area that Apache would serve, and if you move moodledata to some place that is outside of DocumentRoot but still accessible, then you have not denied access to it.

Do you mean file (directory) permissions of Unix? Try putting moodledata under moodle and protecting it through file permissions. LOL

No, using file permissions would not work, since the directory must be accessible to Apache.  There are other ways, but I won't mention what they are, because I don't want to encourage people to use them, since the best thing to do is to put the directory outside of a publicly accessible area.

Average of ratings: Useful (1)
In reply to Gavin McKay

Re: moodledata folder location

by Paul Lovatt -

I am also using a shared server and I was advised by 1and1 to point my domain at the moodle folder (which it appears is the way you have yours set up) and then place the moodledata next to it in the root.  There is no way for me to have moodledata outside of public_html (or equivalent on your server) and you're probably in the same position.  [I don't know how you managed to convince the install to work with that setting, but you say it is working.]

So, as your domain is set up to go to the moodle folder and not the root, it looks like you can simply move your moodledata outside of the moodle folder and it will have a level of security by anonymity.  You will need to tell your config.php file where your moodledata has moved to, by deleting the extra /moodle in the address.

In reply to Gavin McKay

Re: moodledata folder location

by Gavin McKay -

Thanks everyone for the replies.

Yep Paul, we have the same hosting!! I've moved the folder now and updated the config.ini but I'm getting a error 500 message. 1and 1 seems to take a while to rebuild things when you make some configuration changes so I'll wait and then try again.

I'll let you all know what happens later!

 

Gavin

In reply to Gavin McKay

Re: moodledata folder location

by Gavin McKay -

Well looks like I've broke it! Don't know how unless I need to edit more files.
This is what I did:

Moved \moodle\moodledata to \moodledata (where \ is the server root)
edited config.ini to read:

$CFG->wwwroot   = 'http://vle.somedomain.co.uk';
$CFG->dirroot   = '/homepages/xx/xxxxxxx/htdocs/moodle';
$CFG->dataroot  = '/homepages/xx/xxxxxxx/htdocs/moodleData';

I thought this was all that was needed but I'm just getting 500 internal server error messages.

Tried putting everything back where it was but that's giving the error message now!

Am I up for a reinstall?

Gavin

In reply to Gavin McKay

Re: moodledata folder location

by Gavin McKay -

Ok....patience is a virtue but after I moved the folders once again to the correct location without any further edits it's all started working again-go figure!!

I was just about to copy all the files and embark on a fresh install. Thanks for the help and links. Good helpful reading there.

Gavin

In reply to Gavin McKay

Re: moodledata folder location

by Paul Lovatt -

Glad you got it working.  The way Moodle is set up to install at the moment it is not possible, it seems to me, to proceed on a shared server without the workaround of pointing your whole domain at the moodle folder.  I got no help on this from moodle docs, and certainly not the installation pages, but 1and1 came to the rescue.

This is not ideal, but there you go.  If you want to add any other pages to your website you will have to put them in the moodle folder, but there you go.  I didn't want the word moodle in my moodle address anyway.

In reply to Paul Lovatt

Re: moodledata folder location

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

The instructions you are looking for are 1&1 specific. There is a note in Moodle Docs, http://docs.moodle.org/en/1and1_MySQL_installation. Is it broken?

Otherwise to find out what DocumentRoot is, upload index.html files of variing content to all those directories concerned (/, /htdocs, /moodle, /htdocs/moodle), visit http://vle.yourinst.co.uk/ in your browser and see which one responds. That directory is your DocumentRoot.
In reply to Visvanath Ratnaweera

Re: moodledata folder location

by Doug Moody -

Gavin,

Just guessing here, but one reason your installation stopped working and then started again is possibly because of the PHP version of your host. It might be that 5.2 was installed initially, and then they upgraded to 5.3. When all the files worked their way through the system, then it started to work!

My lesson was that you MUST have the correct PHP version.