Stage 1:
1) Create a self signed certificate by using openssl command
#mkdir -p /etc/httpd/conf/ssl
#cd /etc/httpd/conf/ssl
#openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout server.key -out server.crt -subj '/O=Company/OU=Department/CN=vhost'
2) create seprate directory for ssl access
#mkdir /www/ssl
3) create index.html file in side /www/ssl folder with the below contend .
<html>
<body>
<h3> i am ssl </h3>
</body>
</html>
Stage 2 : SSL configuration on apache httpd.conf file
1) Add the below line to Load the mod_ssl module for ssl configuration in httpd.conf file .
LoadModule ssl_module modules/mod_ssl.so
tip : rename the default configuration file other wise httpd take the default ssl configuration file .
#mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl_bk
2) copy the mod_ssl.so file in to the modules directory.
#cp mod_ssl.so /etc/httpd/modules
3) Add the below line to Enable the ssl port "443" in apache configuration file httpd.conf
Listen 443
4)add the virtualhost entry to enable the virtual host for ssl communication in httpd.conf
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot "/www/ssl"
SSLEngine on
SSLOptions +StrictRequire
<Directory />
SSLRequireSSL
</Directory>
SSLCertificateFile /etc/httpd/conf/ssl/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl/server.key
SSLVerifyClient none
SSLProxyEngine off
</VirtualHost>
5) check the virtual configuration in httpd.conf file syntax
#service httpd configtest
6)start the httpd service
#service httpd start
7)check the ssl port "443" enabled in system
# netstat -vatn |grep 443
8) Access the ssl url in the browse
https://localhost -> you will get the ssl page .