Basic System Security
- Restrict file/folder permissions:
- Use the command: sudo chown -R www-data:www-data /var/www/html/moodle
- sudo chmod -R 755 /var/www/html/moodle
- Prepare backup and upload directories
- Create a separate directory for backup and document storage with the command:
- sudo mkdir /var/www/moodle_backup
- sudo chown www-data:www-data /var/www/moodle_backup
- Check if cron is running correctly:
- Run the command: sudo -u www-data /usr/bin/php /var/www/html/moodle/admin/cli/cron.php

- If the system prints “Cron script completed correctly”, it’s Complete !.