Install Moodle on NS7

I used @areguera’s nethserver-moodle and modified it to support Moodle 3.4 so you may try this module:

yum install

To avoid problems rm old moodle dirs and configs and mysql -e "drop database moodle;" before installation.


Download is available in the wiki now:


I tested (long time ago) to authenticate following ldap or sambaAD for moodle, I don’t know if you did it, this is the commit

1 Like

Still running into php version problems. After installing from your repo, I go to https://server/moodle and get this line:

Moodle 3.4 or later requires at least PHP 7.0.0 (currently using version 5.6.25). Some servers may have multiple PHP versions installed, are you using the correct executable?

I did restart apache/httpd…

Please check if port 9000 is open:

netstat -tlpn | grep fpm

Could you check in your /etc/httpd/conf.d/moodle.conf if the right port is defined?

SetHandler "proxy:fcgi://"

You may try to restart php71-fpm

systemctl restart rh-php71-php-fpm


I could reproduce it with installing nextcloud12 and moodle, it seems both php packages use port 9000:

systemctl stop rh-php56-php-fpm
systemctl start rh-php71-php-fpm

That did the trick for me: stop php56-php-fpm and start php71-php-fpm
Can there be a check during install if a ‘wrong’ version of php is active?

Yes, this could be made. I could restart the services and check if and where php71 is running.

Actually we have two possibilities for php71:

  • nethserver-php-scl with php71-php-fpm opens port 9071 for php71
  • rh-php71-php-fpm open port 9000 for php71

I decided to use the epel based packages because it’s easier to integrate (no need for external repo).

Please try if it works after a reboot. I am afraid it depends on which service opens the port first now.

After reboot I was able to log in moodle…
Just a minor thing. This is probably a moodle config issue, but moodle is available from https://servername.domain.tld/moodle
It would be nice if it could be https://domain.tld/moodle

1 Like

To change it you may set the moodle host property:

config setprop moodle host domain.tld
signal-event nethserver-moodle-update

One more thing: I tried to upload a course. But upload_max_filesize is set to 2M, which is too small.
Where do I find the correct php.ini? scl settings don’t seem to have any influence

It’s in /etc/opt/rh/rh-php71/php.ini

Don’t forget to systemctl restart rh-php71-php-fpm after the changes.

Please tell me your php adjustments to set it in the module as default.

changed upload_max_filesize = 2M
upload_max_filesize = 50M

I successfully restored a backup from my old moodle server… :smiley:

I do have to stop version 56 and start version 71 after each reboot…

1 Like

Thanks for testing! I’ll wait some time, maybe we need some more default settings and then I’ll update the package.

You have two possibilities:

  • Upgrade to Nextcloud 13 which installs nethserver-rh-php71-fpm.
  • Disable rh-php56-php-fpm and enable rh-php71-php-fpm for moodle, it should work for Nextcloud 12 too:
config setprop rh-php56-php-fpm status disabled
signal-event runlevel-adjust
systemctl enable rh-php71-php-fpm
1 Like

pinging @mrmarkuz
I just received an email about a plugin update for Moodle: Own/nextcloud integration. ME GUSTA!

1 Like

Hi Rob,

I installed PHP Collection and using PHP-7.2.
I installed Moodle LTS 3.5 under the vhost: moodle.

All is working correctly.

How do you suggest I should run the PHP file:
with a cron job running every minute as suggested by the Moodle documentation?

Do I have to run the cron job under apache user so as to have the proper user:group if it creates a file or folder?

Thank you in advance,


I would follow the info by Moodle on this one:
Although I can not judge what would be the influence of setting a longer period of, for example, 5 or 15 minutes.
Here some more info what tasks the Cronjob actualy checks and performs:
Looking at that explanation, the 1 minute makes sense…
Since Cron needs to be able to write, It probably needs to run under the account for the vhost. Probably apache.
@michelandre If you want to use a running moodle instance, I am happy to give you access to my moodle instance on my VPS.
@mrmarkuz I see we are still on moodle 3.5 In the meantime moodle 3.7 has seen the light. Are you available for an update?

Yes, I’ll work on it.

1 Like

Hi Rob,

Thank you for your reply.

# crontab -u apache -e
*/5 * * * * /opt/remi/php72/root/usr/bin/php /var/lib/nethserver/vhost/moodle/admin/cli/cron.php > /dev/null

# systemctl restart crond

# tail -f /var/log/cron | grep cron.php
Aug 21 10:30:01 tchana CROND[9245]: (apache) CMD (/opt/remi/php72/root/usr/bin/php /var/lib/nethserver/vhost/moodle/admin/cli/cron.php > /dev/null)
Aug 21 10:35:01 tchana CROND[9539]: (apache) CMD (/opt/remi/php72/root/usr/bin/php /var/lib/nethserver/vhost/moodle/admin/cli/cron.php > /dev/null)
Aug 21 10:40:01 tchana CROND[9832]: (apache) CMD (/opt/remi/php72/root/usr/bin/php /var/lib/nethserver/vhost/moodle/admin/cli/cron.php > /dev/null)

Administration -> Logs -> /var/log/cron.

I use the LTS version because it will be Security Supported until April 2021:

What do you think of using local LDAP only for the Moodle users?

Thank you for your excellent “Install Moodle on NS7” howto, it helped me a lot.


Hi @michelandre
Good to see you figured it out… :wink: crontab is looking good.

Using local LDAP (either openldap or samba4AD) is a decision you will have to make. It has pro’s and con’s
pro: if you get a lot of users you do not have to create LDAP accounts for them with possibly (unwanted) permissions to other services on your server. Every user is only available for Moodle.
con: you might have double administration of users.

On my server I used Samba4 AD as accountprovider and configured Moodle to use that since I don’t have that many users and don’t think there will be a lot in the future neither.

Another hint if you want to create interactive material for Moodle: Howto install Xerte Online Toolkits

I am getting nudged to update my moodle install. Current version is 3.9 and latest LTS version of Moodle is 3.11.5+
@mrmarkuz Any chances for an updated package/install procedure?