Skip To Main Content

Certificates

Solutions

Join our Newsletter

Contact Us

How to Install Your SSL Certificate on an Apache HTTP Web Server

This guide provides step-by-step instructions for installing your certificate in Apache HTTP Server.

This guide provides step-by-step instructions for installing your certificate in Apache HTTP Server.

Note: As of version 2.4.8, the default configuration options have changed.

Prerequisites:

  1. Copy your certificate to your server. This includes your server certificate, private key, and an intermediate certificate, The private key would have been generated along with the certificate signing request (CSR); it may very well already be on the server. If the private key is lost, you will need to reissue your certificate. 

2. Your server certificate can be obtained from the delivery e-mail.

3. Alternatively, you can get it from your GlobalSign Account by clicking “Edit” on your order and copying the Certificate PEM Format text from the details. 

The intermediate certificate used will vary depending on the product type. Click on your product type in our intermediate certificate section by clicking on the link below:

https://trustzone.com/knowledge-base-topic/roots-and-intermediate-ca-certificates-globalsign/

Install the Certificate:

Open your Apache configuration file for editing

This will generally be found in one of the following locations, depending on your OS:

On CentOS/RedHat:

/etc/httpd/httpd.conf

/etc/httpd/sites-enabled/name-of-virtualhost.conf

On Debian/Ubuntu:

/etc/apache2/apache2.conf

/etc/apache2/sites-enabled/name-of-virtualhost.conf

The configuration may be in a different location. Detailed mapping of configuration paths can be found on the Apache Wiki.

4. Configure your virtual host to use the certificate.

5. Locate the virtual host for your site:

<VirtualHost xxx.xxx.x.x:443>

    DocumentRoot /var/www/examplesite

    ServerName example.com

    ServerAlias www.example.com

    SSLEngine on

    SSLCertificateFile /path/to/examplesite.crt

    SSLCertificateKeyFile /path/to/privatekey.key

    SSLCertificateChainFile /path/to/intermediate.crt

</VirtualHost>
 

 6. Point the following directives to the corresponding certificate:
 

  • SSLCertificateFile: This should point to your server certificate
  • SSLCertificateKeyFile: This should point to your server’s private key
  • SSLCertificateChainFile: This should point to the intermediate certificate for your product

Note: As of Apache 2.4.8

The SSLCertificateChainFile directive was deprecated and SSLCertificateFile was extended to support intermediate certificates.

Adding the intermediate certificate to the end of your certificate will create a chain file for your server.

7. Test your updated configuration:

Depending on your system, run the command:


apachectl configtest

or

apache2ctl configtest

This will detect any errors in your configuration such as mismatched public & private keys, or an incorrect path. 

8. Restart the Apache service

For older versions of Red Hat Enterprise Linux use init scripts as stated below:
 

CentOS/RedHat:

Service httpd restart

Debian/Ubuntu:

Service apache2 restart
 

For Red Hat Enterprise Linux 7 or CentOS 7.0 use the following commands: 

CentOS/RedHat:

Systemctl restart httpd.service

Debian/Ubuntu:

systemctl restart apache2.service
 

Note: Some Apache configurations may show an entry for SSLCACertificateFile. This field is only needed if you use Apache for client authentication. The SSLCACertificateFile would point to a CA certificate or directory of CA certificates that issue certificates you accept for client authentication. 

Jon Tittmann

Vetting/Support Team Lead & OpEx

Jon has been an integral part of TRUSTZONE for the past six years, during which he has acquired substantial expertise in the cyber security field. As the team leader for our support team, he possesses a profound understanding of the sector, enabling him to resolve even the most complex challenges within the certificate industry effectively.

Submit Your Technical Queries Here for Expert Assistance!

We will contact you as soon as possible.

Please enter your details below.