Step-by-Step Guide: Installing Moodle on Windows Server with Apache, MySQL, and SSL
- Gajendra Rathod
- Dec 9, 2024
- 2 min read
Setting up Moodle on a Windows Server involves careful configuration of Apache and MySQL services, creating a database, and securing your site with an SSL certificate. Here's a detailed guide to get you started:
1. Create a Localhost Record
Edit the hosts file in Windows to include your Moodle server domain:
127.0.0.1 training.matchanb.inThis ensures "training.matchanb.in" resolves to the localhost server IP address.
2. Download and Extract Moodle
Download the latest Moodle ZIP file from the official Moodle website.
Extract the ZIP file to C:\Moodle.
3. Start Moodle
Navigate to the C:\Moodle folder and run:
Start Moodle.exe4. Access Moodle via Browser
Open Google Chrome and access:
Note: Avoid using "localhost" or the server IP address for configuration to prevent issues when making Moodle publicly accessible.
5. Configure Moodle Database
Follow the prompts to:
Set up the Moodle database.
Create an admin user and password.
6. Install Apache and MySQL as Services
Run the following commands in the terminal to install Apache and MySQL as Windows services:
Apache:
httpd.exe -k install -n "Apache"MySQL:
mysqld.exe --install MySQL --defaults-file=C:\Moodle\server\mysql\bin\my.ini7. Secure Moodle with SSL (Let’s Encrypt)
Download and install the Certify The Web software.
Obtain an SSL certificate for training.matchanb.in.
8. Configure Deployment Tasks
Set up deployment tasks to copy the SSL certificates to Moodle’s Apache directory:
C:\Moodle\server\certificate\cert.pem
C:\Moodle\server\certificate\private.pem
C:\Moodle\server\certificate\Fullchain.pem
C:\Moodle\server\certificate\chain.pem9. Automate Apache Service Management
For deployment tasks, automate these steps:
Stop the Apache Service.
Deploy the updated SSL certificates.
Start the Apache Service.
10. Update Apache Configuration for SSL
Modify the Apache configuration file to include the SSL certificate paths:
SSLCertificateFile "C:/Moodle/server/certificate/cert.pem"
SSLCertificateKeyFile "C:/Moodle/server/certificate/private.pem"
SSLCertificateChainFile "C:/Moodle/server/certificate/chain.pem"
SSLCACertificateFile "C:/Moodle/server/certificate/Fullchain.pem"Restart the Apache service to apply changes.
Congratulations! Your Moodle installation is now up and running on a secure Windows server. 🚀
💡 Pro Tip: Regularly update Moodle and your certificates to ensure security and performance.
Feel free to share your thoughts or questions below. Let’s build a robust learning environment together! 💻🎓









Comments