How to install an SSL certificate on Apache

How to install an SSL certificate on Apache

When you connect to a website using HTTP your browser looks for the corresponding IP address, connects to that IP address, and assumes that it is connected to the correct web server. There is no way to verify that you are connected to the correct website. You are on a compromised network that redirects you to an impostor website, therefore passwords and credit card numbers should never be sent over an HTTP connection, a hacker could easily steal them.

This is the second article in a series designed to teach you how to install your SSL certificate with Apache.

Step 1: Generate a certificate request (CSR)

The first step is to generate a certificate request (CSR) on your server before you can purchase and install an SSL certificate. This file contains information about the public key and the key server. It is required to generate the private key. You can generate a CSR directly from the Apache command line. We invite you to consult the steps detailed in this article.

Step 2: Order your SSL certificate

First, you need to have an SSL certificate. If you do not have a certificate you can order your ssl on the OXABOX website

Step 3: Upload your certificates

You will need to download the intermediate certificates from the service from which you purchased your certificates. You will receive your primary certificate by email. Your key should look like this:

-----BEGIN CERTIFICATE-----
[Encoded Certificate]
-----END CERTIFICATE-----
  • You will need to change it to a .CRT file before importing it.
  • There should be five dashes “-” on each side of the BEGIN CERTIFICATE and END CERTIFICATE lines. Also make sure there is no extra space, or line breaks in the key.

Step 4: Upload the certificates to your server

Certificates should be uploaded to a folder dedicated to certificates and key files. All of your certificates should be placed in the same folder.

Step 5: Open the “httpd.conf” file in a text editor

Some versions of Apache contain a file for SSL certificates. Edit only one if you have more than one. Add the following lines in the “Virtual Host” section. Save the changes made to the file when you are finished.

SSLCertificateFile /usr/local/ssl/crt/primary.crt
SSLCertificateKeyFile /usr/local/ssl/private/private.key
SSLCertificateChainFile /usr/local/ssl/crt/intermediate.crt

Step 6: To restart the server

Once the file is loaded, you can start using your SSL certificate by restarting your server. Most versions can be restarted by entering the following commands:

apachectlp stop
apachectl startssl

Step 7: Test the certificate

Use different web browsers to test that your certificate is working. Force SSL connection by connecting to your website using “https: //”. You should see the padlock icon in your address bar.

consult the articles on installing SSL certificates on Microsoft server, Plesk, MS Exchange on your Oxabox web host blog.

  1. How to install an SSL certificate on Microsoft Internet Information Service (IIS)
  2. How to install an SSL certificate on Plesk
  3. How to install a certificate on MS Exchange

OXABOX offers you the installation of SSL certificates on apache by our qualified experts. Do not hesitate to contact us.