sudo a2enmod ssl
Edit the default or copy the default to another file for editing.
sudo nano /etc/apache2/sites-available/default
Add the following inside the mod_rewrite.c bracket.
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
Enable the default-ssl site.
sudo a2ensite default-ssl
Restart apache to reload the setting and make it active.
sudo /etc/init.d/apache2 restart
That's all. See you!
No comments:
Post a Comment