To enable SSL on your website first you need to install SSL on your server. Install SSL Certificates
- 1. First edit ssl file in apache2 directory.
root@Linoide:~# vim /etc/apache2/sites-available/default-ssl.conf
Add these lines:
<VirtualHost>ServerAdmin webmaster@localhost DocumentRoot /var/www/html Servername linoide.com Serveralias www.linoide.com </VirtualHost>
Change your SSL file location on these lines
SSLCertificateFile /etc/letsencrypt/live/linoide.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/linoide.com/privkey.pem
2. Now link default ssl file as shown below and restart apache2 service.
root@Linoide:~# ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default-ssl.conf root@Linoide:~# systemctl restart apache2.service
3. Run this command to enable ssl
root@Linoide:~# a2enmod ssl
That’s it. You are done with your ssl configuration. Now open your URL with https://
———- ———–
If you want to redirect all http request into https then add this line in to your apache2 configuration file
my case, file name is “etc/apache2/sites-enabled/000-default.conf“
Redirect / https://www.linoide.com/
after adding this line, It will looks like this
ServerAdmin webmaster@localhost DocumentRoot /var/www/html Servername linoide.com Serveralias www.linoide.com Redirect / https://www.linoide.com/
Restart the service and you are good to go.
Thank you.