post

Erro ao gerar certificado SSL Bitnami com novos domínios

Instalação do certificado SSL Let’s Encrypt com pacote LAMP Bitnami

Ao rodar o comando

sudo /opt/bitnami/bncert-tool

Gera o seguinte erro:

Unmonitored apache
AH00526: Syntax error on line 66 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf:
SSLCertificateFile: file '/opt/bitnami/apache2/conf/{DOMINIO}.crt' does not exist or is empty
apache config test fails, aborting

Error: Something went wrong when running the following command:

 $ backup_configuration

Please check our documentation or open a ticket in our community forum, our team will be more than happy to help you!

 Documentation: https://docs.bitnami.com/
 Support: https://community.bitnami.com/


We are going to try to recover the web server configuration now...

Unmonitored apache
AH00526: Syntax error on line 66 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf:
SSLCertificateFile: file '/opt/bitnami/apache2/conf/{DOMINIO}.crt' does not exist or is empty
apache config test fails, aborting
AH00526: Syntax error on line 66 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf:
SSLCertificateFile: file '/opt/bitnami/apache2/conf/{DOMINIO}.crt' does not exist or is empty
apache config test fails, aborting
Monitored apache

1. Verificando os arquivos ” bitnami.conf”

Executar o comando:

sudo cat /opt/bitnami/apache2/conf/bitnami/bitnami.conf | grep "SSLCertificateFile\|SSLCertificateKeyFile"
sudo cat /opt/bitnami/apache2/conf/bitnami/bitnami.conf.back | grep "SSLCertificateFile\|SSLCertificateKeyFile"

Caso o comando a cima imprima o mesmo resultado.
Será necessário rodar o seguinte código abaixo para reverter seu nome da string para “server”

sed -i 's/{DOMINIO}.crt/server.crt/g' /opt/bitnami/apache2/conf/bitnami/bitnami.conf
sed -i 's/{DOMINIO}.key/server.key/g' /opt/bitnami/apache2/conf/bitnami/bitnami.conf

Obs: Trocar o valor {DOMINIO} pelo endereço de domínio do site.

Depois disso teste as configurações do apache

apachectl -t

Caso precisa use o comando:

sudo /opt/bitnami/ctlscript.sh restart apache

Após isso você pode rodar novamente o comando para gerar o certificado SSL

sudo /opt/bitnami/bncert-tool

Fontes:
https://community.bitnami.com/t/error-when-generating-ssl-for-multiple-domains/65952/4
https://docs.bitnami.com/general/infrastructure/lamp/administration/generate-configure-certificate-letsencrypt/