Wednesday, April 20, 2016

Installing ssl certiciface on apache

Edit your vhost file located at /apache2/conf/extra/httpd-vhosts.conf if you're using bitnami stacks.

Add the following secure vhost file to enable SSL on your site

<VirtualHost *:443>
    DocumentRoot "/opt/lampstack-5.5.31-0/apache2/htdocs/your_site/public"
    ServerName yoursite.com:443
    ServerAlias www.yoursite.com:443
    <Directory "/opt/lampstack-5.5.31-0/apache2/htdocs/yoursite/public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    SSLEngine on
    SSLCertificateFile /opt/lampstack-5.5.31-0/apache2/conf/yoursite.crt
    SSLCertificateKeyFile /opt/lampstack-5.5.31-0/apache2/conf/yoursite.key
</VirtualHost>


if You would like to konw how the private key and csr file can be generate, go to the following link 

http://laraveldevelopmentonwindows.blogspot.com/2016/04/adding-ssl-to-laravel-site-running-on.html

Installing intermediate File
Some browser may tell that your ssl certificate is not secured and you might need to install intermediate chain file to remove that error

https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO6252

https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=INFO1548

Go to the above link to copy the certificate contents.
In your server, create a new file yoursite_intermediate.crt file
below SSLCertificateKeyFile line in your virtual host settings, add the following line

SSLCertificateChainFile /opt/lampstack-5.5.21-0/apache2/conf/yoursite_intermediate.crt
if SSLCertificateChainFile is not working for some server, use SSLCertificateFile instead

Restart apache server





No comments:

Post a Comment