Getting SSL certificates
The first steps towards securing apache is to get the SSL certificates. To get the certificates one can contact the certificate issuing authority. The issuing authority is the once which issues the SSL certificates. To get it you might need to submit the basic information in the form of CSR(Certificate Signing request). One can generate the CSR using the OpenSSL, for detailed steps please refer: https://in.godaddy.com/help/generating-a-certificate-signing-request-csr-apache-2x-5269
Configure Apache to use SSL certificates
We have the SSL certificates ready now. Now we need to move the ssl-certificate.crt and ssl-certifcate.key file to ${apache_home}/conf directory
- Open up ${apache_home}conf/httpd.conf file
- Search for the LoadModule ssl_module modules/mod_ssl.so and remove any pound sign(#) character proceeding it.
- Add below:
Listen 443 <VirtualHost _default_:443> ServerAdmin <admin@domain.com> DocumentRoot "Your root folder location" ServerName www.domain.com:443 ServerAlias domain.com:443 ErrorLog "${apache_home}/logs/anyFile-error.log" CustomLog "${apache_home}/logs/anyFile-access.log" SSLEngine on SSLCertificateFile "${apache_home}/conf/server.crt" SSLCertificateKeyFile "${apache_home}/conf/server.key" </VirtualHost> Note: Make sure that "SSLCertificateFile" and "SSLCertificateKeyFile" are properly located.