Install & Enable HTTPS on Apache Server
Install & Enable HTTPS on Apache Server
First of all, you need to have a website that can run under http. This tutorial is about Apache2, and other servers may have similar settings.
- Get a free SSL certificate.
Now Let’s Encrypt offers free SSL certificate service. So we need to register an account. Then, after landing you can apply for a free SSL certificate. Finally save the requested certificate locally. - Configure the Apache2 environment
This will automatically install the SSL plugins required for Apache2.
Create a default SSL site that will be in /etc/apache2/sites-enabled/ to generate a configuration file.
In /etc/apache2/creating two folders
Upload *.crt to ssl.crt folder, upload *.ssl to ssl.key folder.
Next, we start the configuration default-ssl.conf fileIn which the following attributes are changed
After the change is successful, restart the Apache2 service
Finally, try to access https://YourDomain
- Enable https by default
On .htaccess file, add
After the creation is complete, change /etc/apache2/apache2.conf
- Enjoy