lcp

How To Enable SSL In Moodle?

In the following guide we will provide you with information on how to configure your Moodle application to load from a secure connection using a SSL certificate.



First you should purchase or deploy a free SSL certificate for the domain on which you have installed the Moodle application. If you do not wish to purchase a SSL certificate for your domain you could use the Let’s Encrypt SSL certificate which is entirely free and available on all of our packages.

To Install the Let’s Encrypt SSL certificate for your domain access your cPanel account and navigate to the Let’s Encrypt SSL tool:

Once you have accessed the tool you will be provided with a page where in the first section you have all active Let’s Encrypt SSL certificates in your account. The second section will provide you with information on all available domains in your account on which you could deploy the Let’s Encrypt SSL certificate.

If your domain does not have Let’s Encrypt SSL certificates you will find it in the second section and to install Let’s Encrypt SSL certificates on it you should click on the “+Issue” button and on the next page you should click on the “Issue” button. If the domain is properly pointed to you account the SSL certificate will be deployed properly.

When the SSL certificate is deployed properly on your domain open the File Manager tool in your cPanel account:

Once you have opened the File Manager tool navigate to your Moodle application document root and open the config.php file with a Text Editor:

Once you have opened the file to edit it you will be displayed with the configuration information of your Moodle application:

On this page you should change the line of code “$CFG->wwwroot”. As you could see currently the domain is configured to load via HTTP protocol which is not secure. To configure your Moodle application to load via HTTPS protocol you should change the URL from which is loading your domain to include HTTPS as follow:

Once you have changed the URL from which your Moodle application will load you should select “Save Changes”

Once you have saved the changes to the config file of your Moodle application you should clear your browser cache and cookies and reload your Moodle application. The Moodle application should load via HTTPS protocol.