In order to enable SSL in my website, I’m using free certificate provided by Cloudflare. Here’s a quick guide about how to set up free Cloudflare SSL on your Apache server.
Apply for SSL Certificate
First, you need to sign up a free account on Cloudflare. Then, follow their steps for changing the DNS of your domain and link your website to Cloudflare.
Once you’ve changed your nameservers and are operating your site with Cloudflare as your DNS provider, click the Crypto button on the top of your dashboard. Then find Origin Certificates and create a certificate.
Choose “Let Cloudflare generate a private key and a CSR” and set the private key type to RSA. Add your domain to the list of the hostnames. Then set “Certificate Validity” to 15 years.
Once you have clicked the “Next” button, you will see “Origin Certificate” and “Private Key”. Save them into two text files: <Your Domain>.crt and private.key and upload them to your server.
Install SSL Certificate In Apache Server
Apache’s main configuration file is typically named
Possible locations for this file might be
Open the configuration file:
Delete ‘#’ of this line:
Configure the <VirtualHost> block for SSL. Here is a sample virtual host block:
SSLCertificateFile /<Path>/<Your Domain>.crt
Test Apache Configuration and restart Apache Server:
Finally, open https://<Your Domain> in your web browser and check if SSL works well.