Setting up self-signed SSL certificate for Apache on CentOS 5

To set up self-signed SSL certificate for Apache on CentOS 5, do the following

1. Create a self-signed certificate
# make /etc/pki/tls/certs/self_signed_cert.pem

2. Enter the information such as country, province, state, company, division etc. These information will be reflected in your self-signed certificate

3. Configure the ssl configuration
# vim /etc/httpd/conf.d/ssl.conf

4. Update ssl.conf, ensure SSLCACertificateFile and SSLCACertificateKeyFile points to the newly created self-signed certificate
...........
SSLCACertificateFile /etc/pki/tls/certs/self_signed_cert.pem
SSLCACertificateKeyFile /etc/pki/tls/certs/self_signed_cert.pem
..........

5. Restart the httpd service
# service httpd restart

6. Check your https :)