Installing the required files

Mod_ssl sets up the self -signed certificate

Yum install mod_ssl openssl –y

Create a directory to store SSL keys

Mkdir /etc/httpd/ssl

Generate a self-signed certificate

OpenSSL will gernerate a self-signed certificate.

• Generate private key

Openssl genrsa –out ca.key 2048

• Gernate CSR

Openssl req –new –key ca.key –out ca.csr

• Generate Self Signed Key

Openssl x509 –req –days 365 –in ca.csr –signkey ca.key –out ca.crt

Copy the files another location

Cp ca.crt /etc/httpd/ssl/ca.crt
Cp ca.key /etc/httpd/ssl/ca.key
Cp ca.csr /etc/httpd/ssl/ca.csr

Update the Apache SSL config file

Vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf

Change the path to match where the keys are stored

Take out # between and

SSLCertificateFile /etc/httpd/ssl/ca.crt
SSLCertificateKeyFile /etc/httpd/ssl/ca.key

Restart Apache

Service httpd restart

If you have a firewall setup add the following line

Iptables –A INPUT –p tcp –dport 443 –j ACCEPT

Restart iptables

Service iptables restart

Leave a Reply

Your email address will not be published. Required fields are marked *