In today's digital landscape, having an SSL certificate for websites is critical, not only for security but also for SEO performance. In this guide, we will walk you through the process of setting up an SSL certificate obtained through ZeroSSL on Apache and Tomcat servers step by step.
Firstly, you need to sign up and log in to the ZeroSSL website. Visit https://app.zerossl.com to do so. Follow these steps once logged in:
Transfer Certificate Files: Move the SSL certificate files you received from your provider to the /etc/ssl directory. The private key should be placed in the private sub-directory of the same directory.
/etc/ssl/ca_bundle.crt/etc/ssl/certificate.crt/etc/ssl/private/private.keyEdit Apache Settings: Modify the default-ssl.conf file of Apache:
nano /etc/apache2/sites-available/default-ssl.conf
Make the following additions or changes to the file:
ServerName yourdomain.com
SSLCertificateFile /etc/ssl/certificate.crt
SSLCertificateKeyFile /etc/ssl/private/private.key
SSLCertificateChainFile /etc/ssl/ca_bundle.crt
Enable SSL Mode:
sudo a2enmod ssl
Activate SSL Site:
sudo a2ensite default-ssl
Restart Apache:
systemctl reload apache2
Verification: Use the command below to verify:
apachectl -t -D DUMP_VHOSTS
If the output shows port 443, it indicates the setup has been completed successfully.
Merging Certificate and CA Bundle:
cat certificate.crt ca_bundle.crt > mybundle.crt
Certificate Conversions:
openssl pkcs12 -export -out yourdomain.com.pfx -inkey private.key -in mybundle.crt -password pass:YourPassword123
keytool -importkeystore -srckeystore yourdomain.com.pfx -src
storetype pkcs12 -srcalias 1 -srcstorepass YourPassword123 -destkeystore yourdomain.com.jks -deststoretype jks -deststorepass YourPassword123 -destalias yourdomain.com
Edit Tomcat Settings: Make the following additions or changes to the server.xml file:
Note: In the example above, the domain used is yourdomain.com. Ensure you replace it with your actual domain.
By following this guide, you can effortlessly set up an SSL certificate on both Apache and Tomcat servers. Not only does SSL enhance the security of your website, but it also plays a crucial role in boosting your position in Google search rankings. Therefore, setting up SSL for your website is of paramount importance.