#generate SSL cert for apache

openssl version

OpenSSL 1.0.0-fips 29 Mar 2010

cd /etc/pki/tls/certs
openssl genrsa -out mycert.pem 2048
ls -alh mycert.*
openssl req -new -key mycert.pem -out mycert.csr
ls -alh mycert.*
openssl x509 -req -days 365 -in mycert.csr -signkey mycert.pem -out mycert.crt
ls -alh mycert.*
cp mycert.pem mycert.csr /etc/pki/tls/private/

# A single SSL enabled virtual host

httpd-2.2.15-28.el6.centos.i686

mySslEnabledVirtHost.conf

LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

<VirtualHost _default_:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/mycert.crt
        SSLCertificateKeyFile /etc/pki/tls/private/mycert.pem
        <Directory /var/www/myweb>
                AllowOverride All
        </Directory>
        DocumentRoot /var/www/myweb
        ServerName subdomain.mydomain.com:443
</VirtualHost>