Knowband Blog | Ecommerce Modules

Setup SSL on the site on Linux Server

Step by Step Guide to Setup SSL on the site on Linux Server:

1. Copy the certificate files to the server

There should be 3 SSL files:

Note: Make them readable by root only to increase security.

2. Find the Apache configuration file (httpd.conf) you need to edit.

3. Identify the SSL <VirtualHost> block you need to configure.

Below is a very simple example of a virtual host configured for SSL. The parts listed in blue are the parts you must add for SSL configuration.

<VirtualHost 192.168.0.1:443>

DocumentRoot /var/www/html2

ServerName www.yourdomain.com

SSLEngine on

SSLCertificateFile /path/to/your_domain_name.crt

SSLCertificateKeyFile /path/to/your_private.key

SSLCertificateChainFile /path/to/DigiCertCA.crt

</VirtualHost>

4. Adjust the file names to match your certificate files.

SSLCertificateFile is your DigiCert certificate file (e.g., your_domain_name.crt).

SSLCertificateKeyFile is the .key file generated when you created the CSR (e.g., your_private.key).

SSLCertificateChainFile is the DigiCert intermediate certificate file (e.g., DigiCertCA.crt)

Note: If the SSLCertificateChainFile directive does not work, try using the SSLCACertificateFile directive instead.

Recommended Blog: How to install MySQL on Windows and Linux Systems?

5. Test your Apache configuration file before restarting.

As a best practice, check your Apache configuration file for any errors before restarting Apache.

Caution: Apache won’t start again if your configuration files have syntax errors.

Run the following command to test your configuration file (on some systems, it’s apache2ctl):

apachectl configtest

6. In case of no error please restart apache using the below command

service apache2 restart

After restarting apache2, you can check whether your SSL is set up correctly or not using https://www.sslshopper.com/ssl-checker.html. In the above screenshot, you have to verify that the arrow should be green like above between server and chain. If there is no issue then your SSL is set up correctly.

Recommended Blog: SSL Certificate Installation on IIS

Final Words:

In case of an issue while implementing the code, feel free to reach out to us at support@Knowband.com. Also, Knowband offers eCommerce store plugins at the best price. We offer the smartest solution for online platforms including PrestaShop, OpenCart, Magento 2 and WooCommerce.

This May Also Interest You:

How to upgrade the Magento version on LINUX