Overview
In Part One of this series, we covered the basic requirements and initial steps for installing Moodle, including:
- Hardware and software requirements
- Downloading and unpacking Moodle
- Creating the Moodle data directory
- Configuring the web server, database server, and PHP
- Running the initial Moodle installation
Now in Part Two, we will focus on properly configuring, optimizing, and securing your Moodle installation for production use.
Configure Moodle
After completing the initial installation, there are some important configuration steps you should take:
Set System Paths
- Set the correct file system paths for Moodle data and other directories in
config.php
.
Configure Cron Job
- Set up a cron job to run Moodle scheduled tasks. This is critical for things like asynchronous activity deletion.
- A typical cron entry will run the Moodle cron script every minute:
* * * * * /usr/bin/php /path/to/moodle/admin/cli/cron.php > /dev/null
Configure Email
- Set up an SMTP email server and test that Moodle can send email notifications properly.
Set Up Authentication
- Configure a suitable authentication method like LDAP, Shibboleth, or manual accounts.
- Consider using web services authentication for external systems.
Optimize Performance
Here are some tips for improving performance:
Enable Caching
- Database query caching can significantly improve performance.
- Consider a distributed memory cache like Redis or Memcached.
Optimize Database
- Add indexes on large tables like
mdl_log
andmdl_sessions
. - Maintain key distribution by optimizing MyISAM tables monthly.
Configure Web Server
- Tune your web server configuration to handle expected loads.
- Enable compression, caching, static content optimization.
- Consider setting up multiple front-end web servers.
Enhance Security
It’s critical to properly secure your Moodle site:
Apply Security Recommendations
- Follow all default Moodle security recommendations.
Set File Permissions
- Use the most restrictive file permissions suitable for your environment.
Disable Unneeded Features
- Disable any unnecessary features or functionality.
Install Security Plugins
- Consider security-related plugins like SpamCleaner to enhance protection.
Use HTTPS
- Require HTTPS sitewide for all connections.
Schedule Backups
- Automate regular backup tasks and test restores.
Conclusion
Configuring performance optimization, security hardening, backups, and other site management policies upfront will ensure your production Moodle installation runs smoothly as it scales to meet your organization’s needs. Check out Part Three for tips on customizing the Moodle user experience, integrating with third-party systems, and developing custom plugins.