Install SSL on Apache Web Server

A technical guide for installing your SSL certificate on an Apache web server. This involves uploading the files and editing the virtual host configuration.

Prerequisites

You need shell access (e.g., via SSH) to your server and root or sudo privileges. Make sure you have the certificate.crt, private.key, and ca_bundle.crt files ready.

Step-by-Step Installation

  1. Upload Certificate Files to Your Server
    Copy your three certificate files to a directory on your server. A common practice is to create a directory inside /etc/ssl/. For example: /etc/ssl/your_domain/.
  2. Enable the Apache SSL Module
    The Apache SSL module, mod_ssl, must be enabled. You can do this with the command (on Debian/Ubuntu):
    sudo a2enmod ssl
  3. Configure the Virtual Host File
    Locate your domain's virtual host configuration file. This is typically in /etc/apache2/sites-available/. You need to edit the virtual host block for port 443. If it doesn't exist, you can copy your existing port 80 block and modify it.
  4. Add SSL Directives
    Inside your <VirtualHost *:443> block, add the following lines, updating the file paths to match where you uploaded your files:
    SSLEngine on
    SSLCertificateFile /etc/ssl/your_domain/certificate.crt
    SSLCertificateKeyFile /etc/ssl/your_domain/private.key
    SSLCertificateChainFile /etc/ssl/your_domain/ca_bundle.crt
  5. Test Your Configuration
    It's crucial to test your Apache configuration for syntax errors before restarting.
    sudo apache2ctl configtest
    If it returns "Syntax OK", you are ready to proceed.
  6. Restart Apache
    Apply the changes by restarting the Apache service.
    sudo systemctl restart apache2

Verify the Installation

After Apache restarts, check that your website is loading correctly over HTTPS. Use our free SSL Certificate Checker to get a full report on your new SSL setup.