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
| #!/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 |