Category Archives: How To

How to: Apache virtual host ssl configuration

Just thought of quickly putting this code on how to setup Apache virtual host ssl as when I initially setuped SSL certificate, it took me a while to setup. Hope this will help some one like me to quickly configure ssl on apache.

  #SSL works on port 443
SSLEngine on   #Start SSL engine
SSLCertificateFile /etc/httpd/ssl/server.crt    #path to your SSL certificate file
SSLCertificateKeyFile /etc/httpd/ssl/server.key #path to you SSL certificate key
 
ServerName example.com  #Your server name
ServerAlias example.com   #Your server name
 
DocumentRoot /var/www/example    #path to your website root folder
 
AllowOverride All
Options All
Order deny,allow
Allow from all

Once this is setupped correctly you will be able to use your URL by adding https in the beginning.

Note: You will need mod_ssl enabled in your PHP configuration

Leave your comments below if you need further help for apache virtual host ssl configuration and I will reply.