Hi,
This is my first time working with moodle, and I'm relatively noob with Linux/Apache/MySQL/PHP, so bear with me...
I was tasked w/ migrating our moodle site off of Site5 hosting onto a couple of local servers. We are splitting our database and web roles due to a moderate volume of concurrent users. So far I have managed to get everything working OK EXCEPT images. All image content on the site (including theme-based images for the interface) load up with placeholders.
Earlier, I had encountered an issue loading ANY content in the moodledata directory and was /hoping/ that would resolve everything.. But apparently not.
The issue I had earlier was that I had uploaded the moodledata folder with Filezilla without specifying binary mode. This caused it to auto-to ascii mode which corrupted the files in that folder. After specifying binary and re-uploading, user uploaded documents will now download or display correctly in the browser.
I'll just lay out the process I went through to get moodle on the new servers.
I am running the latest LTS of Ubuntu Server on both machines. MySQL is installed on one machine and Apache/PHP is installed on the other.
The Moodle I am migrating is at version 2.5.1 (Build: 20130708)
I had originally installed a fresh moodle (latest version) to verify that, in its basic form, it was working (it was). When I started the migration, I brought the fresh server down (by stopping apache) and removed the moodle and moodledata directories. I did not touch the mysql database.
Our hosting service had placed the moodledata folder at ~/moodledata and the moodle web files folder at ~/www/moodle and pathed the config.php file appropriately
For the migration, I opted to have the new server respond to the same http header as our current publicly hosted Site5 server at moodle.eosmith.org ... Eventually, the new server will take that DNS entry anyway. I edited the hosts file on my PC to point to the IP of the internal server instead of the Site5 server so I could test it. This way I can avoid having to run the replace.php script to update the url prefixes in the database.
- used Filezilla on my PC to FTP into the Site5 server and download the moodle web and moodledata folders.
- also FTPed down the dump of the MySQL database.
- uploaded the MySQL dump to the database server and the moodle web and moodledata folders.
- imported the dump to the MySQL database with no errors.
- placed the moodle folder on the new server at /usr/share/moodle
- ran "find /usr/share/moodle /exec chown root {} \;" to set root as the owner of all files and directories under and including moodle. did the same with chgrp.
- ran "find /usr/share/moodle -type d chmod 755 {} \;" to set permissions on all directories under and including /usr/share/moodle
- ran "find /usr/share/moodle -type f chmod 644 {} \;" to set permissions on all files under /usr/share/moodle
- did the above examples but with chown/chgrp www-data and chmod 700/600 for directories/files in /var/lib/moodle
- modified apache httpd.conf and virtual directory configuration to respond to http://moodle.eosmith.org
- modified the paths appropriately in /usr/share/moodle/config.php
As I mentioned, content, links and styles all work correctly. It's just images that won't display. I copied a PNG file directly into the root directory and opened it on the site to verify that it wasn't an apache configuration issue with regards to loading images... Directly accessing the .PNG file works fine. I also verified that the filehash entry in the mdl_files table in the database was correct and pointing to a non-corrupt copy of the file in /var/lib/moodle/filedir. The pathing on the URL appeared to be what the pluginfile.php file was looking for.
I'll attach my apache, php and moodle configuration files.
I would greatly appreciate any advice on this... Thanks in advance.