Search code examples
wordpressamazon-web-servicesubuntu-16.04bitnami

Accidentally deleted server.crt from bitnami


I Accidentally deleted server.crt from /opt/bitnami/apache2/conf/. I am unable to open my website since then. How would I regenerate it or get it back?


Solution

  • Bitnami Engineer here,

    You can generate new certificates by running these commands:

    sudo openssl genrsa -out /opt/bitnami/apache2/conf/server.key 2048
    sudo openssl req -new -key /opt/bitnami/apache2/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr
    sudo openssl x509 -in /opt/bitnami/apache2/conf/cert.csr -out /opt/bitnami/apache2/conf/server.crt -req -signkey /opt/bitnami/apache2/conf/server.key -days 365
    sudo chmod 600 /opt/bitnami/apache2/conf/server*
    

    They will generate new self-signed certificate files. In case you bought a valid certificate from a Certificate Authority, you only need to copy the files to the apache2/conf folder again.

    Restart Apache to load this new certificate

    sudo /opt/bitnami/ctlscript.sh restart apache
    

    More information about this in our documentation

    https://docs.bitnami.com/aws/apps/wordpress/#how-to-create-an-ssl-certificate