Last active
December 6, 2022 22:10
-
-
Save nullx5/2c95fdffa1e28cdec3a5bf8c533442a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configurando HTTPS letsencrypt con cerbot en apache | |
########################################################### | |
sudo snap install --classic certbot | |
sudo ln -s /snap/bin/certbot /usr/bin/certbot | |
sudo certbot --apache | |
########################################################### | |
REDIRECIONAR HTTP A HTTPS | |
/etc/apache2/sites-available/000-default-le-ssl.conf | |
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName blessedc0de.brazilsouth.cloudapp.azure.com | |
Redirect / https://blessedc0de.brazilsouth.cloudapp.azure.com | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName blessedc0de.brazilsouth.cloudapp.azure.com | |
DocumentRoot /var/www/html | |
SSLEngine On | |
############################################################# | |
sudo systemctl restart apache2 | |
191.233.245.24 | |
blessedc0de.brazilsouth.cloudapp.azure.com | |
############################################################# | |
INPIDE QUE SE ACCEDA POR LA IP SOLO ACCESO POR EL DOMINIO | |
cd /var/www/html | |
.htaccess | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://blessedc0de.brazilsouth.cloudapp.azure.com/$1 [L,R=301,QSA] | |
RewriteCond %{HTTP_HOST} !^blessedc0de.brazilsouth.cloudapp.azure\.com$ [NC] | |
RewriteRule (.*) https://blessedc0de.brazilsouth.cloudapp.azure.com/$1 [L,R=302,QSA] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment