Install a 1&1 SSL Certificate on Ubuntu 16.04

Table of Contents

Introduction

After you set up a 1&1 SSL certificate, you will need to install the certificate in order to encrypt the traffic on your server. Learn how to install an SSL certificate on a 1&1 Cloud Server with Ubuntu 16.04 Linux.

Note: For any 1&1 Cloud Server with Plesk, SSL certificates should always be added and managed through the Plesk interface. See our article Install a 1&1 SSL Certificate on a Cloud Server with Plesk for step-by-step instructions.

Requirements

  • A 1&1 Cloud Server with Linux (Ubuntu 16.04)
  • An SSL certificate
  • The SSL certificate private .key file.

For step-by-step instructions on obtaining an SSL certificate, see the article Set Up a 1&1 SSL Certificate.

The SSL certificate private key is created when the SSL certificate is set up. During the creation process, you are instructed to save this private key file to a safe location on your computer.

Download the SSL Certificate File

Log in to the Control Panel and click My Products > SSL Certificates.

![Install a 1&1 SSL Certificate on Linux: Control Panel](fileadmin/community/Screenshots/Networking/SSL_Certificates/Install_a_1_1_SSL_Certificate_on_Ubuntu_16.04 install-an-ssl-certificate-ubuntu-01.jpg "Install a 1&1 SSL Certificate on Linux: Control Panel")

Click the domain you used to set up the SSL certificate.

![Install a 1&1 SSL Certificate on Linux: Click the domain](fileadmin/community/Screenshots/Networking/SSL_Certificates/Install_a_1_1_SSL_Certificate_on_Ubuntu_16.04 install-an-ssl-certificate-ubuntu-02.jpg "Install a 1&1 SSL Certificate on Linux: Click the domain")

Download the SSL certificate.

![Install a 1&1 SSL Certificate on Linux: Download certificate](fileadmin/community/Screenshots/Networking/SSL_Certificates/Install_a_1_1_SSL_Certificate_on_Ubuntu_16.04 install-an-ssl-certificate-ubuntu-03.jpg "Install a 1&1 SSL Certificate on Linux: Download certificate")

This will save the certificate file to your computer.

Install the SSL Certificate

Upload the private key (.key) and certificate (.cer) files to your home directory on the server. For step-by-step instructions on how to use SCP to securely upload files to a 1&1 Cloud Server with Linux, see our tutorial Upload a Website to a 1&1 Cloud Server with Linux.

Connect to the server with SSH and go to your home directory:

cd ~

Move the certificate file to the /etc/ssl/certs/ directory:

sudo mv *.cer /etc/ssl/certs/

Move the key file to the /etc/ssl/private directory:

sudo mv *.key /etc/ssl/private/

Configure Apache

Open the default SSL virtual host file for editing:

sudo nano /etc/apache2/sites-available/default-ssl.conf

Change ServerAdmin to your valid email address:

ServerAdmin webmaster@localhost

Below this line, add the ServerName with either the domain name or IP address:

ServerAdmin webmaster@localhost
ServerName example.com

Find the lines which read:

SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Change these to the location and name of your SSL certificate and key file:

SSLCertificateFile      /etc/ssl/certs/example.com_ssl_certificate.cer
SSLCertificateKeyFile /etc/ssl/private/example.com_private_key.key

Save and exit the file.

Enable SSL on the server:

sudo a2enmod ssl

Enable the SSL virtual host:

sudo a2ensite default-ssl

Restart Apache for the changes to take effect:

sudo systemctl restart apache2

You will now be able to visit the SSL-secured version of your site with a URL like https://example.com.

Comments

Tags: SSL Certificates