Commit 606330dd authored by Dashamir Hoxha's avatar Dashamir Hoxha

Script for fixing apache2 config to redirect automatically to https

parent 45b6bc22
#!/bin/bash -x
a2enmod ssl proxy proxy_http rewrite
a2ensite 000-default default-ssl
# redirect all http requests to https
sed -i /etc/apache2/sites-available/000-default.conf \
-e '/<VirtualHost \*:80>/ a\' \
-e '\t### redirect http to https\' \
-e '\tRewriteEngine On\' \
-e '\tRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}\' \
-e ""
### restart apache2
systemctl restart apache2
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment