Install Moodle on NS7

I was talking about Moodle with @robb and others recently so I just installed Moodle 3.4 which needs PHP 7 which I took from nethserver-php-scl by @stephdl :

  • tried postgres 9.6 from SCL without success, now mariadb with mariadb connector is used
  • PHP 7.1
  • custom template /etc/e-smith/templates-custom/etc/opt/remi/php71/php.ini/90moodle for PHP7.1 settings
  • /etc/my.cnf.d/moodle.cnf for mysql config

This is just for the installation of the new version, for extra settings like AD check the first post of @robb and following…just copy/paste the following to a terminal:

yum -y install http://mirror.de-labrusse.fr/NethServer/7/x86_64/nethserver-stephdl-1.0.6-1.ns7.sdl.noarch.rpm
yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install nethserver-mysql nethserver-php-scl php71-php-opcache php71-php-xmlrpc php71-php-intl
wget https://download.moodle.org/download.php/direct/stable34/moodle-latest-34.tgz
tar -xzf moodle-latest-34.tgz
mv moodle /var/www/html/
mkdir /var/www/moodledata
chown -R apache:apache /var/www/moodledata /var/www/html/moodle
mysql
create database moodle character set utf8mb4 collate utf8mb4_bin;
grant all privileges on moodle.* to moodle@localhost identified by 'SECRET';
exit;
mkdir -p /etc/e-smith/templates-custom/etc/opt/remi/php71/php.ini/
cat << EOF > /etc/e-smith/templates-custom/etc/opt/remi/php71/php.ini/90moodle
[opcache]
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 8000
opcache.revalidate_freq = 60
; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0
[intl]
intl.default_locale = en_utf8
EOF
cat << EOF > /etc/my.cnf.d/moodle.cnf
[client]
default-character-set = utf8mb4
[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake
[mysql]
default-character-set = utf8mb4
EOF
signal-event nethserver-php-scl-update
systemctl restart httpd
systemctl restart mysqld
  • Set php version to 7.1 in php settings in web UI
  • Browse to https://NETHSERVER/moodle
  • DB Type is MariaDB
  • db user moodle, password SECRET
2 Likes