Hi everyone,
Moodle (acronym for Modular Object-Oriented Dynamic Learning Environment) is a free software e-learning platform, also known as a Learning Management System, or Virtual Learning Environment (VLE). As of June 2013 it had a user base of 83,008 registered and verified sites, serving 70,696,570 users in 7.5+ million courses with 1.2+ million teachers. [wikipedia]
The latest version of Moodle is 2.5 (as of today) and the latest version of SME Server is 8.0 (as of today). Moodle requires PHP 5.3.3 (built in to SME8.0 ) and MySQL 5.1.33 (SME8 has 5.0.95).
There exists a problem as the latest mysql (5.5.32) does not work properly and fails to load up in SME8.
We have made an rpm that includes the latest Moodle 2.5 and figured out a way in getting MySQL to start.
The below steps is how we did this.
We first enable the InnoDB property of mysqld service.
/sbin/e-smith/db configuration setprop mysqld InnoDB enabled
Expand configuration to register
/sbin/e-smith/expand-template /etc/my.cnf
Then we fetch the latest MySQL 5.3.3 from the atomic repository as so:
/sbin/e-smith/db yum_repositories set atomic repository Name 'Atomic EL5' MirrorList '
http://www.atomicorp.com/mirrorlist/atomic/centos-5-$basearch' GPGCheck yes GPGKey '
https://www.atomicorp.com/RPM-GPG-KEY.art.txt' Visible no
Signal event now to register the yum command in accepting the added repository above:
/sbin/e-smith/signal-event yum-modify
Finally we yum install the MySQL with the command:
/usr/bin/yum -y --enablerepo='atomic' install mysql
At this point, MySQL still fails to start up properly. For are going to be adding a template that is related to InnoDB.
We first make the directory of the file we want to expand: (read SME Developer Manual to understand the logic behind why we do this)
/bin/mkdir -p /etc/e-smith/templates-custom/etc/my.cnf/
The template that we want to expand to form my.cnf: call it 009innodb and have the following contents:
{
my $innodb = $mysqld{InnoDB} || 'disabled';
return "skip-innodb" unless $innodb eq 'enabled';
# innodb is enabled. We'll use the MySQL-AB-recommended innodb
# defaults for small to medium sites, from the my-medium.cnf file
# distributed with MySQL
$OUT .= "innodb_data_home_dir = /var/lib/mysql/\n";
$OUT .= "innodb_data_file_path = ibdata1:10M:autoextend\n";
$OUT .= "innodb_log_group_home_dir = /var/lib/mysql/\n";
$OUT .= "innodb_buffer_pool_size = 16M\n";
$OUT .= "innodb_additional_mem_pool_size = 2M\n";
$OUT .= "innodb_log_file_size = 5M\n";
$OUT .= "innodb_log_buffer_size = 8M\n";
$OUT .= "innodb_flush_log_at_trx_commit = 1\n";
$OUT .= "innodb_lock_wait_timeout = 50\n";
}
We then copy this file to the template directory to be expanded:
cp /path/to/009innodb /etc/e-smith/templates-custom/etc/my.cnf/009innodb
Naturally, we finally expand this template to form my.cnf file:
/sbin/e-smith/expand-template /etc/my.cnf
All of the changes need to be registered in as post-upgrade and mysqld service would need to be restarted for the changes to take effect. Maybe a reboot command would be nice as well.
/sbin/e-smith/signal-event post-upgrade;
/usr/bin/sv t mysqld
The final step that we would want to do is install Moodle 2.5 over this.
We have made an RPM that installs the moodle directory in /opt/moodle/ . We would run the rpm installation command as:
rpm -i --nomd5 /path/to/moodle-2.5.0-01.noarch.rpm
You can find this RPM in my sourceforge.net project:
https://sourceforge.net/projects/moodle25forsmeserver80/So this is how we did this. MySQL works well and seems to be compatible with Moodle. SME9 should support a much newer version of mysql that Moodle would support. What we did above is set up MySQL and play with SME8's default settings to make this work.
This is a good intermediate solution in my opinion before SME9 is released. Both moodle and SME8 seems to function as intended.
Thanks,
Varuna