File: //etc/apache2/sites-enabled/unitask-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName unitask.riarauniversity.ac.ke
DocumentRoot /var/www/unitask
<Directory /var/www/unitask>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/unitask_error.log
CustomLog ${APACHE_LOG_DIR}/unitask_access.log combined
# Redirect HTTP to HTTPS
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteCond %{SERVER_NAME} =unitask.riarauniversity.ac.ke
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
SSLCertificateFile /etc/letsencrypt/live/unitask.riarauniversity.ac.ke/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/unitask.riarauniversity.ac.ke/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>