How to Install an SSL/TLS Certificate on Drupal?
Here’s Guide to Install an SSL/TLS Certificate on Drupal
In case you’re wondering what the server and intermediate certificates and private keys are-
- Server Certificate: It’s the certificate you will get from the CA for the domain. It’s usually sent through email or you can even download it by visiting your account’s dashboard by clicking on the order.
- Intermediate Certificate: Often referred to as the CA Bundle, an Intermediate certificate is a subordinate certificate issued by the trusted root for issuing end-entity server certificates.
- Private Key: It’s a cryptographic key that is obtained by the recipient of an SSL/TLS Certificate. It’s a file that must be on your server or with you if you’ve generated the CSR.
SSL Installation Steps for Drupal
1. Configure a Server
Steps to Configure Your Server
- Go to the admin login page and log-in to it.
- If your organization has more than one Drupal website, select the one that you want to secure with HTTPS. On the control panel page, click the File manager button and navigate to the webRoot directory for the domain name of the company. Now, click go or open to create a new tab.
- Select New File or Addfile from the File Manager main menu and create a new file named as .htaccess. Mostly, this file will be automatically generated by the file manager after you click the Create New File button and it’ll display it in the list of your files and folders on the webserver.
Once you finish creating .htaccess file, move on to the below steps.
2. Enabling SSL
Steps to Edit .htaccess File
- On your cPanel, go to File Manager
- The File Manager pop up will open. Select Home Directory and click on the checkbox Show Hidden Files (dotfiles).
- Now, locate the .htaccess file in the folder where you installed Drupal and edit it. You’ll have different options to edit it. For instance, command-line text editor. Here, we are using the editor of the cPanel File Manager. Click the edit button at the top bar.
- In the .htaccess file, find: RewriteEngine and paste the following command below that:
- Once you add the above command and save the .htaccess file, HTTPS will be enabled onto your Drupal website.
3. Verify Installed SSL/TLS Certificate
- Once you edit the .htaccess file, exit from the File Manager and log out from your web hosting cPanel. Now, go to Drupal’s admin page and log in as the admin.
- On the admin toolbar, locate Select Site > Global Configuration > System
- Beside the “use Apache mod rewrite” option, select YES. At the top of the menu, click the “save” button and exit the administrator section of the website.
- Finally, check whether you followed all the steps correctly. To checkt, enter your company’s Drupal website in the browser’s address bar and hit enter. Whether you enter http://www.Mydomain-name.com or www.Mydomain-name.com, the edited .htaccess file will redirect to the HTTPS (SSL) version of the site.