For various reasons I might wish to install several separate moodle installations with my GoDaddy Ultimat Shared Linux plan. Since I must create a moodledata (or equivalent name) for each installation I wanted to just check to be sure I could put all of these moodledata (i.e. equivalent but each with a distinct name) in one place in the directory structure. In other words, is it possible to have a structure like this:
/moodledataopen1 as the moodledata directory this installation
/moodledataopen2 as the moodledata directory for the second encapsulated installation
I assume so, but I thought it best to check before breaking anything.
Yes, that is fine. You don't even have to put the words moodledata anywhere in the name.
On the other hand, everyone does call it moodledata, so putting those words in there is a very sensible choice.
The bit I would not recommend is putting the version number in the folder name. You must be planning to upgrade later in order to get security and bug fixes, so leave the 223 out of the name of the 'moodle' folders.
Hello again. After many months and an upgrade to virtual dedicated server (Linux) I now have another question related to where to put the /moodledata directory. i am obviously doing something wrong at present in my new setup since I have a red error message staring at me when I check in Moodle 2.3.3. I now have a VDS with full access to the root via SSH and two domains associated with the directories /site1 and /site2 in the directory structure i don't seem to be able to create moodledata above this using Plesk (I get a mkdir error), but I could go to a non-Web visible directory via SSH. Is that what I should do? Currently I fear my moodledata directory is visible via the web, as it is sitting at the same level as /admin and all the other Moodle installed directories. I should also point out that I am having major performance problems that might be caused by this mistake (though that would imply someone is up to something nasty, something I have no way of knowing is happening). The question is what should I do about moving my /moodledata directory, which currently has stuff i see in /cachem /user and other directories that have been created under Moodle. as i have a course starting soon and just uploaded 30 users into the user database i wouldn't want to do something very silly by simply deleting the current moodledata directory. I have also just finished writing a whole course, though i don't know where that is written: into moodledata. I also assume i need to change the reference to moodledata location in config.php if/once I change the placement of moodledata. Right? Any help just before my course it supposed to start would be appreciated.
Well, I just contradicted myself and created a moodledata directory under /private above the Web-served directories and went into config.php and pointed the dataroot reference to this new moodledata directory and then went into Moodle and then looked at the contents of the new /moodledata directory and lo and behold I see /cache and the other directories happily siting there. Not quite sure about the permissions to this directory yet, but at least it seems to have become a recepticle for the right moodle data. Should I now delete the old one, or is there information I might need/could use from it?
moodledata contains all the files you have uploaded into your courses/front page in Moodle. Therefore, if you have done any work in Moodle previously that used file uploads, you'll want to copy the contents of the moodledata directory from it's past location to it's new location.
Hi Bret. Many thanks for this I will do this. Also, could you tell me the permissions I should set the /private directory in which the new moodledata is sitting? Also, though I have not yet moved the old moodledata contents over, I am getting an "Invalid JSON String" message every time I try and upload any images. This is something I didn't get before. Any idea what's going on with that? Or is it related to missing contents. It's as though the system is simply unable to allow any uploading from my harddisk, giving me an Invalide JSON String before I can do anything uploadwise.
OK, I did what you suggested, but I still get the Invalid JSON String message. I wonder if I should restart the server? Also, I wonder what permissions settings I should have for /private/moodledata now that the contents of the old moodledata are there...?
I just found an interesting .htaccess entry in my original .htaccess file copied over from the old moodledata contents that says:
deny from all
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!
I bet this might have something to do with the Invalide JSON String message. And I must fox this; otherwise I will not be able to upload anything to my site in future!
Hi Rick, good to hear from you. I've come a long way since last time, but recently I started having all sorts of performance problems on my server, this 2 days before the start of a course. Well, the fine folks at GoDaddy fixed that, but now I have new problems. They might be related to the fact that I moved my moodledata folder from a wrong place (under a place in the Webserver to a new place outside that); seems that after that move things went wrong. I did go to config.php and change the dataroot entry to point to the new place /private/moodledata and I see it's been populated. Or maybe a permissions thing both for private directory and moodledata subdirectory. whatever it is, i can neither upload people's photos not new files of any kind! fortunately I just finished actually doing the course yesterday. attached is the screen capture of my environment page that looks the way it should. any thoughts would be very helpful. i will be up very late i think!
I have the complete error that really does seem to have to have something to do with the change of moodledata directories if you could give me an email address to send it.
I have a workaround for this problem, which is probably something I did. It's to restore my server to the state it was in just before the issue. Question: I know that it is critical to put the moodledata directory in a place where it is not visible via the web. But if I must for any reason i read that it is possible to protect it via an .htaccess file. I even see on the web what lines should be in that file. Question 2: where should that .htaccess file sit? I saw one sitting in the moodledata directory itself. It that the place, or is it elsewhere?
Yes, the moodledata directory is the place for the .htaccess file to protect it.
Gary, have you double-checked the "rights" to moodledata? I think the recommendation is 755 (which is where mine are), but you might even try 777. I think that you want to make sure that you apply these rights recursively (i.e., to all subfolders).
If moodledata is not within your public_html (or the Plesk equivalent folder), you shouldn't need to worry about .htaccess, I believe. But in checking my moodledata directory, I do see a .htaccess file in it. I cannot remember if I ever put it there, or if the Moodle install did this for me. I do see it in my experimental install of moodle, so I tend to think that it was created by Moodle. This one contains the following:
deny from all
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!
You can email me at email@example.com, if you need to.
Like Tim says, it will work fine, I do the same thing all the time. Just have to remember to give each installation it's own cookie prefix at Site Administration > Server > Session Handling > Cookie Prefix. If you don't, little things like logging out of one, will log you out of both.
Many thanks for this help. Didn't think about the cookie business; will check into this. Now another "small" problem with respect to GoDaddy hosting if I might. Though they do allow the hosting of version 2.3.2 of Moodle, which works just fine with their automated MySQL 5.0 install, to use version 2.3.2 it's necessary to use it with version 5.1.33 of MySQL. Well, the problem is I am on what they call, a bit hyperbolically/euphemistically, the Ultimate Shared Linux hosting plan, meaning that I have no way of getting to certain directories higher up (and hidden) thatn /html to install applications. They are suggesting that I upgrade to dedicated hosting or virtual dedicated, but they are asking a bit too much to ask me to upgrade just because they limit the version of MySQL offered to the general public to version 5.0. What I was wondering is whether there might be a way to manually install MySQL 5.1.33 on a directory at the same level as my .../html/moodle232 directory in my hosting account itself. (Normally I noticed that the 5.0 database sits on another server entirely and is pointed to during manual install of Moodle 2.2.3) Since this is a test sandbox site I am playing around with here with a completely different domain name I don't think I'll break much. But it would be nice to know whether you think this possible before spending the couple hours extracing the 5.1.33 zip and uploading the result to my GoDaddy host.
Don't host with GoDaddy so this is off top of head from reading too many of those 'catch 22' docs of shared hosted services offerings. ;)
Me thinks one should be prepared for failure. :| At least I hope so (sorry to say that) cause it could mean a lot of holes in their shared system. Do you ever wonder what protects users from one another on a shared system?
Or, worse yet, be prepared to have GoDaddy disable your account on shared hosted box IF you do find a way to install a higher version of MySQL and successfully get it to serve ... if they 'catch' you.
What does your agreement with GoDaddy say?
just my 2 cents!
'spirit of sharing', Ken
That "catch me" putting MySQL 5.1.33 on under the cover of darkness could be problem. True. In my dealings with them they specifically said that to put 5.1.33 on I'd need to move to dedicated or virtual dedicated hosting. Maybe I just limit myself to 2.2.3, installations, which are all working just fine with the automated 5.0 install button they stick in there and wait till someone important calls and "urges" them to upgrade to 2.3.2. Am I missing much by not having the latest, greatest stable 2.3.2 version? Thanks for these tips. Actually, though I know it ain't very politically correct to say this, after ENORMOUS problems for a while there and at least 20 phone calls to their technical people who "were aware of the load-balance issues" I upgraded to Ultimate Shared Hosting for only a couple bucks more per month and got a free SSL certificate to impress people at cocktail parties with and am now, after lots of little tweaks to the php5.ini file, seeing very good performance. End of political announcement.