Loading ...
Try HTTPCS +33 1 85 09 15 09

How to install SSL certificate on Apache2

On 20/08/2015 By Thomas Huther

Before starting to install your SSL, you need to :

You need : To have already generated your CSR.

To have already saved the private key when you generated the CSR.

To have already root access on the server.

To have already already installed OpenSSL. How to install SSL certificate on Apache2

Enable Apache's SSL module. How to install SSL certificate on Apache2

Then restart Apache How to install SSL certificate on Apache2

Have received the validation of the CSR by the certificate authority (CA). Once the CSR is validated, you can download the certificate on your HTTPCS account in « My SSL Certificates » and click on « Download ».

How to install SSL certificate on Apache2



Start to install your SSL on Apache2

NB : All the following commands have to be executed as root user.

1. Create a directory named « ssl » in Apache's directory.
How to install SSL certificate on Apache2

2. Extract the archive you just downloaded on your HTTPCS account. How to install SSL certificate on Apache2

NB : If you've obtained 2 files as « CACertificate-1.crt » and « CACertificate-2.crt », go to the folder with these files and execute the following command. This will concatenate the two files in a single one. How to install SSL certificate on Apache2

NB : Your file should look like this : How to install SSL certificate on Apache2

3. Go to the « sites-available » directory in Apache's configuration directory : How to install SSL certificate on Apache2

4. Find the VirtualHost's configuration file named after your domain name (exemple.conf in the image below). How to install SSL certificate on Apache2

NB : If you need to make your website accessible with HTTP and HTTPS, you will need one VirtualHost configuration file for both. Copy the actual VirtualHost and modify it for the HTTPS. If you want your website only accessible through HTTPS, modify the existing VirtualHost.


5. Open your VirtualHost's configuration file with your favorite text editor.
How to install SSL certificate on Apache2

NB : To read more easily, I have removed all comments

Be careful : This file is case sensitive !

Check if the configuration port is 443, if not, replace it with 443
« SSLEngine on » is used to active SSL module
« SSLCertificateKey » indicates the path to your private key's file (you obtained it when you’ve generated the CSR)
« SSLCertificateFile » indicates the path to your server certificate
« SSLCertificateChainFile » indicates the path to your CACertificate bundle. (The one you've just created with the "cat" command)

6. Test your Apache configuration to be sure you didn't make any syntax error executing the following command :
How to install SSL certificate on Apache2

If the command outputs "Syntax OK", you can reboot your Apache server typing How to install SSL certificate on Apache2

Now, please test your SSL certificate.

Buy a cheap SSL certificate for Apache

HTTPCS desktop screenshot Scanner HTTPCS tablet screenshot Scanner HTTPCS phone screenshot Scanner