Install SSL certificate on Apache webserver
The following commands are performed on commandline.
Please note: this manual may differ from your environment, depending on the Linux distribution used and your personal configurations.
When the request for your SSL certificate is completed, it will be sent to you in a zip file containing, at least, the following files:
- The CA root certificate
- One or more intermediate certificates
- Your certificate
- A readme file
The certificate will be installed on the server in the folder you indicate. While most Linux distributions use a default SSL folder, /etc/ssl/, it is recommended to create separate folders on your server where you save your certificates and your private keys. In this example, we use the folders /etc/ssl/certificates and /etc/ssl/keys.
Place your intermediate certificate and your own certificate in the certificates folder, and your private key in the keys folder.
If your SSL certificate was sent to you with multiple intermediate certificates, it is recommended to combine these into one file. This is done with the following command:
cat intermediatecert1.cer intermediatecert2.cer > intermediates.cer
Open the configuration file of the website for which the SSL certificate was requested. In this example, this file is located in /etc/apache2/sites-available/.
Add the following lines to your configuration file:
Save your configuration file. This will look similar to the following example:
Check the syntax of your configuration with a configtest:
Restart your Apache installation with the following command:
systemctl restart apache2
Your SSL certificate has been installed. To check whether the installation was performed succesfully, you can scan your website with our Quickscan.