[Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux

Table of Contents

[Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux

Export Private Key and Certificate from PFX file

Export the Private Key
openssl pkcs12 -in domain.com.pfx -nocerts -out domain.com.pem -nodes

Export the Certificate
openssl pkcs12 -in domain.com.pfx -nokeys -out domain.com.crt -nodes

Update the certificate

update-ca-certificates

Config Vhost SSL

<VirtualHost *:443>
    DocumentRoot "/abc/xyzdir/"
    ServerName domain.com
    ErrorLog "logs/domain.com-error.log"
    CustomLog "logs/domain.com-access.log" combined
    SSLEngine On
    SSLCertificateFile "/usr/local/share/ca-certificates/domain.com.crt"
    SSLCertificateKeyFile "/usr/local/share/ca-certificates/domain.com.pem"
    # SSLCertificateFile "/opt/lampp/etc/ssl.crt/server.crt"
    # SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/server.key"
    <Directory "/abc/xyzdir/">
        AllowOverride All
        # Order Allow,Deny
        Allow from all
        # --New way of doing it
        Require all granted 
    </Directory>
</VirtualHost>

References

Leave a Reply

Your email address will not be published. Required fields are marked *