Saturday, March 20, 2021

some post install changes needed for moodle

I had made a test moodle server by copying over the database, moodledata and /var/www/html/moodleinstalldirectory to a different server. Additionally, the following changes needed to be made.

  • Had to set up the cron job. The instructions given at MoodleDocs were to create it as the www-data user, crontab -u www-data -e 

    First ran it on the command-line to test that it works, running it as the www-data user with
    sudo -u www-data /usr/bin/php   /var/www/sssvv/admin/cli/cron.php
    - that took 2 minutes to run the first time, but later runs finished in a second or so.

    But on this Ubuntu 20.04 machine, a cron set for www-data did not work - probably as a security feature - though it did have a file in /var/spool/cron/crontabs as a comment on this page mentions. So, made a cron job as root, but running as www-data as per this post.
    * * * * * su www-data -s /bin/bash -c "/usr/bin/php /var/www/sssvv/admin/cli/cron.php"

  • Had to increase the php file upload limit
    sudo nano /etc/php/7.4/apache2/php.ini
    ( Ctrl+w to find and change post_max_size
    Ctrl+w to find and change upload_max_filesize
    Ctrl+w to find and change max_execution_time  - set to 600 for now.)
    sudo apachectl restart

  • Make the disk mount permanent by editing /etc/fstab - had to find the UUID of the partition using
    lsblk -f
    sudo blkid

    and then in /etc/fstab, added the line at the end,
    UUID=<uuid found using blkid>   /datadrive/mount/path   ext4   defaults,nofail   1   2
    Doing a umount and then a mount -a would mount it from fstab, so that we can correct errors if any. 

No comments:

Post a Comment