Jason Parms

The CentOS Linux distribution is a steady, convenient, and consistent platform obtained from the sources of Red Hat Enterprise Linux (RHEL). The CentOS project is modeled on the structure of Apache foundation. If you have an Apache CentOS server and want to install SSL, then this article will help you very much.

  1. After receiving an SSL certificate from the certificate authority, download the primary and intermediate certificate.
  2. Copy your SSL certificate files to your Apache server. You should have a key file on the server-generated with your CSR (certificate signing request).
  3. Find httpd.conf or ssl.conf file presented in the Apache configuration. To edit these files you can use the following commands:
    # cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.BAK 
    # nano /etc/httpd/conf.d/ssl.conf
    
  4. If one or more file is explained, then remove the # character from the line and set the value of directives to the absolute path based on Apache version.
    Apache Version < 2.4.8
    DirectivesPath to Enter
    SSLCertificate FileCertificate file path
    SSLCertificate KeyFileKey file path
    SSLCertificate ChainFileIntermediate bundle path
    Apache Version  2.4.8 +
    DirectivesPath to Enter
    SSLCertificate FileCertificate file path
    SSLCertificate KeyFileKey file path
    SSLCertificate PathIntermediate bundle path
  5. You can add the absolute path to each directive, as shown in below examples:
    SSLCertificateFile /etc/httpd/conf/ssl.crt/your_leaf_certificate.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/your_domain_name.key
    SSLCACertificatePath /etc/httpd/conf/ssl.chain/your_intermediate_chain.crt
    
  6. Now save your configuration file and restart Apache.

Your SSL certificate is installed on CentOS. You can use our SSL installation checker that will help you to diagnose issues.