After Setup Tomcat with Apache Web Server in Linux, you might want to transfer the SSL certificate from Apache Tomcat Server to Apache Web Server.
- Convert Tomcat SSL Certificate to Apache Web Server SSL Certificate:
- keytool -importkeystore -scrkeystore [tomcat key file] -destkeystore [new p12 key file] -srcstoretype jks -deststoretype pkcs12
- openssl pkcs12 -in [new p12 key file] -out [new pem file]
- openssl x509 -text -in [new pem file]
- (command above will show some text, copy the certificate portion and paste to a new certificate file)
- [Optional] Convert the certificate to run without password
- openssl rsa -in [new pem file] -out [no password pem file]
- openssl x509 -text -in [no password pem file]
- (same as step 1, copy the certificate portion and paste to a new certificate file)
- Edit httpd.conf:
- uncomment “Inlucde conf/extra/httpd-ssl.conf”
- enable mod_ssl
- enable mod_socache_shmcb
- Edit httpd-ssl.conf:
- SSLCertificateFile [certificate file location]
- SSLCertificateKeyFile [pem file location]
- add JkMount /[SSL Web] balancer