Manually install an SSL certificate on my Apache server (Ubuntu)


After your certificate request is approved, you can download your certificate from the SSL manager and install it on your Apache server. If your server is running CentOS instead of Ubuntu, please see Manually install an SSL certificate on my Apache server (CentOS).

    1. Find the directory on your server where certificate and key files are stored, then upload your intermediate certificate (gd_bundle.crt or similar) and primary certificate (.crt file with randomized name) into that folder.
    2. Find your Apache configuration file.
grep -i -r "SSLCertificateFile" /etc/apache2/
    1. Open this file with your favorite text editor.
    2. Inside your apache2.conf file, find the CODE_LESS_THAN VirtualHost CODE_GREATER_THAN block.
    3. To have your site available on both secure (https) and non-secure (http) connections, make a copy of this block and paste it directly below the existing CODE_LESS_THAN VirtualHost CODE_GREATER_THAN block.
    4. You can now customize this copy of the CODE_LESS_THAN VirtualHost CODE_GREATER_THAN block for secure connections. Here is an example configuration:
<VirtualHost xxx.xxx.x.x:443>
	DocumentRoot /var/www/coolexample
	ServerName coolexample.com www.coolexample.com
		SSLEngine on
		SSLCertificateFile /path/to/coolexample.crt
		SSLCertificateKeyFile /path/to/privatekey.key
		SSLCertificateChainFile /path/to/intermediate.crt
</VirtualHost>
    1. First, run the following command to check your Apache configuration file for errors:
apache2ctl configtest
    1. Confirm that the test returns a Syntax OK response. If it does not, review your configuration files.

Warning: The Apache service will not start again if your config files have syntax errors.

    1. After confirming a Syntax OK response, run the following command to restart Apache:
apache2ctl restart

Note: As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products. Third-party marks and logos are registered trademarks of their respective owners. All rights reserved.



Article ID: 1490
Created On: Wed, Dec 2, 2020 at 8:47 PM
Last Updated On: Wed, Dec 2, 2020 at 9:08 PM

Online URL: https://www.heartinternet.uk/support/article/manually-install-an-ssl-certificate-on-my-apache-server-ubuntu.html