All Products
Search
Document Center

Certificate Management Service:How to enable the mod_ssl module in Apache?

Last Updated:Nov 14, 2025

Enable HTTPS on an Apache web server by activating the mod_ssl module. This guide covers the prerequisite steps for installing a Secure Sockets Layer (SSL)/Transport Layer Security (TLS) certificate, with commands for Linux and instructions for Windows.

Enable the mod_ssl module on Linux

Enable the mod_ssl module

Run the following steps as the root user or a user with sudo permissions.

Note

These steps apply to Apache 2.x.

CentOS/RHEL

  1. Check the module status.

    sudo httpd -M | grep ssl_module

    If the output contains ssl_module, the mod_ssl module is enabled. You can then install the certificate.

  2. Install the module.

    Run the command for your OS version to install the module. The installation automatically creates the configuration file /etc/httpd/conf.d/ssl.conf.

    CentOS/RHEL 8 and later

    sudo dnf install -y mod_ssl

    CentOS/RHEL 7 and earlier

    sudo yum install -y mod_ssl

Debian/Ubuntu

  1. Check the module status.

    sudo apache2ctl -M | grep ssl_module

    If the output contains ssl_module, the mod_ssl module is enabled. You can then install the certificate.

  2. Enable the module.

    sudo a2enmod ssl

    If the command returns an error, such as a2enmod: command not found or Module ssl does not exist, your Apache installation might be missing core files. To fix this, update your package list and reinstall Apache.

    Note

    Before running the reinstallation commands below, make sure to back up all your Apache configuration files.

    # Update the package list.
    sudo apt update
    
    # Force reinstall to restore any missing core files.
    sudo apt install --reinstall apache2

    Enable the module again:

    sudo a2enmod ssl

    Check the module status again:

    sudo apache2ctl -M | grep ssl_module

    If the output contains ssl_module, the mod_ssl module is installed and enabled.

Install an SSL certificate

See Install an SSL certificate on an Apache server (Linux).

Enable the mod_ssl module on Windows

Note

This topic uses Apache 2.4.x installed in C:\Apache24 as an example. Adjust the file paths in the instructions to match your actual installation directory.

Enable the mod_ssl module

  1. Check the module status.

    Navigate to the C:\Apache24\modules directory. If the mod_ssl.so file is present, the mod_ssl module is available. If the file is not present, go to the Apache official website to download and reinstall the latest version of Apache for Windows.

  2. Enable the module.

    Use a text editor to open the main Apache configuration file httpd.conf as an administrator (for example, C:\Apache24\conf\httpd.conf). In the file, find and uncomment the following two lines by removing the leading # symbol:

    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    LoadModule ssl_module modules/mod_ssl.so

    Save the file and close the editor.

Install an SSL certificate

For more information, see Install an SSL certificate on an Apache server (Windows).