How Do I Install an SSL Certficate on My Linux Server?
How do I install an SSL certficate on my Linux server?
- First you need to obtain the SSL certificate. After buying your SSL certificate you'll receive several files from your Certificate Authority (CA), typically including your SSL certificate file and your CA bundle file which you will need to perform the installation.
- Next, upload the SSL certificate files to your Linux server. It's common to place them in /etc/ssl/certs/ or /etc/apache2/ssl/.
- Now you'll need to configure Apache. Open your Apache configuration file for your site. This might be located in /etc/apache2/sites-available/ or /etc/httpd/conf.d/.
- Run the following command:
sudo nano /etc/apache2/sites-available/your_domain.conf
Add the following lines to your VirtualHost configuration to specify the paths to your SSL certificate files:
apache
<VirtualHost *:443>
ServerName your_domain.com
DocumentRoot /var/www/html SSLEngine on
SSLCertificateFile /etc/ssl/certs/your_domain.crt
SSLCertificateKeyFile /etc/ssl/private/your_domain.key
SSLCertificateChainFile /etc/ssl/certs/ca_bundle.crt <Directory /var/www/html>
AllowOverride All
</Directory>
</VirtualHost>Run the following command to enable the SSL module and your site configuration:
sudo a2enmod ssl sudo a2ensite your_domain.conf
Restart the Apache service to apply the changes with the following command:
sudo systemctl restart apache2
Finally, use an SSL checker tool, such as SSL labs, to check that the SSL certificate is installed correctly.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article