Skip to content

Instantly share code, notes, and snippets.

View antoniocesar16's full-sized avatar

Antônio César antoniocesar16

View GitHub Profile
@antoniocesar16
antoniocesar16 / ativar_https.sh
Last active June 28, 2025 04:41
Código de ajuda para resolver o "Acesso permitido apenas por https"
#!/bin/bash
# Criado por Antônio César
# Backup the original file
cp /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/000-default.conf.backup
# Create SSL certificate
sudo openssl req -x509 -nodes -days 300 -newkey rsa:2048 -keyout /etc/ssl/private/apache_ssl.key -out /etc/ssl/certs/apache_ssl.crt -subj "/C=BR/ST=Estado/L=Cidade/O=Empresa/CN=$(hostname -I | awk '{print $1}')"
# Replace the SSL certificate path in the config file