Gandi Wiki


Questions

Configuring Apache to use your Gandi SSL Certificate

Important:

If you quit Gandi AI mode to install a SSL certificate on some virtualhost, please report to the following documentation to have the good configuration & packages before processing this tutorial.

Installation of Apache 2

First of all, you need to install the application on the server.

aptitude install apache2

Then, you need to activate the ssl module (we will reload Apache later):

a2enmod ssl

Next, be sure that Apache listens on the HTTPS port. In the file /etc/apache2/ports.conf, add:

<IfModule mod_ssl.c>
    Listen 443
    NameVirtualHost VOTRE_ADRESSE_IP:443
</IfModule>

…if it is not already present.

Generation of the intermediary certificates

So that your certificate can be recognized as having been issued by an approved certification authority, you need to recover the intermediary certificates issued by Gandi : Retrieving the Gandi intermediate certificate

Activate a domain under Apache SSL

Install your keys/certificates and any necessary intermediary certificates (to form a string) in, for example: /etc/ssl

cp cert-domain.tld.crt /etc/ssl/certs/domain.tld.crt
cp monserveur.key /etc/ssl/private/domain.tld.key
cp GandiXXXSSLCA.pem /etc/ssl/certs/GandiXXXSSLCA.pem

Important:

Don't forget to replace every occurence of domain.tld with your own domain. The exact filename GandiXXXSSLCA.pem can vary depending on which type of certificate you got from Gandi.

To add a domain name to your secure Apache, create a dedicated website:

vi /etc/apache2/sites-available/000-domain.tld-ssl

…and add the virtualhost of your domain in the following manner:

  <VirtualHost YOUR_IP_ADDRESS:443>

        ServerName www.domain.tld
        ServerAlias domain.tld
        DocumentRoot /var/www/www.domain.tld/
        CustomLog /var/log/apache2/secure_access.log combined

        SSLEngine on
        SSLCertificateFile /etc/ssl/domain.tld.crt
        SSLCertificateKeyFile /etc/ssl/domain.tld.key
        SSLCertificateChainFile /etc/ssl/GandiXXXSSLCA.pem
        SSLVerifyClient None

  </VirtualHost>

Then activate the SSL website by reloading Apache:

a2ensite 000-domain.tld-ssl
/etc/init.d/apache2 reload

Note:

If your server has a firewall, do not forget to open the HTTPS port 443.

Check your completed SSL chain

Using the following openssl command with your IP address (or the hostname of the server) and the associated port of the service (443 in cas of apache2/SSL) :

openssl s_client -connect ip.ip.ip.ip:port

Or you can use http://www.digicert.com/help/ to visualize the chain on a more graphical way.

Questions

RSS feed for questions matching this filter (Help)

Last modified: 17 Nov 2011 at 03:42 by Devin T.