Wednesday, 15 August 2018

How to enable SSL Certificate for Apache CentOS 7/ RHEL 7



SSL (Secure Sockets Layer) is a cryptographic protocol that is used to send secure and encrypted traffic between server and client.

Installation of mod_ssl apache module:

Run the following command to install the module if already not installed:

[root@linuxcnf ~]# yum install mod_ssl

Configure SSL certificate and key locations:

Open file “/etc/httpd/conf.d/ssl.conf” and edit the below parameters according to names and locations:

[root@linuxcnf ~]# cp -p /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.ORI
[root@linuxcnf ~]# vi /etc/httpd/conf.d/ssl.conf
ServerName www.linuxcnf.com
SSLCertificateFile /etc/pki/tls/certs/www.linuxcnf.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/www.linuxcnf.com.key

ServerName: Website name.
SSLCertificateFile: Certificate files location.
SSLCertificateKeyFile: Key file location.

Restart the Apache webserver to load the changes:

[root@linuxcnf ~]# service httpd restart

Verify SSL configuration:

Verify the SSL configuration status by browsing URL https://<Server_name/Website_name>.

No comments:

Post a Comment