There was a problem loading the comments.

How to Set Up and Install an SSL Certificate

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

This guide is designed for clients who have purchased an SSL certificate through WHMCS and need to install it on their Linux server (e.g., Ubuntu). The steps below will help you download the SSL certificate files from the WHMCS client area and install them on your server.


Prerequisites

  1. Purchased SSL Certificate: Ensure the SSL certificate has been issued and is ready for use.

  2. Access to WHMCS Client Area: You must have login credentials for the WHMCS client area.

  3. Server Access: Root or sudo access to your Linux server (Ubuntu or other distributions).

  4. Web Server Software: Apache or Nginx installed on your server.

  5. Domain Configuration: The domain for which the SSL certificate is issued must be properly configured and pointing to your server.


Step 1: Download the SSL Certificate Files from WHMCS Client Area

  1. Log in to your WHMCS client area.

  2. Navigate to Services > My Services.

  3. Locate the service associated with your SSL certificate and click on it.

  4. Look for the SSL Certificate section and download the following files:

    • Certificate File (usually .crt or .pem).

    • Private Key (usually .key).

    • CA Bundle (also called Intermediate Certificate, usually .ca-bundle or .pem).

    These files are required for the SSL installation process.


Step 2: Upload the SSL Files to Your Server

  1. Use an FTP client (e.g., FileZilla) or a terminal-based tool like scp to upload the SSL files to your server.

    • Recommended location: /etc/ssl/ (create the directory if it doesn’t exist).

    •  
      scp your-certificate.crt user@your-server-ip:/etc/ssl/
      scp your-private.key user@your-server-ip:/etc/ssl/
      scp your-ca-bundle.crt user@your-server-ip:/etc/ssl/
  2. Ensure the files have the correct permissions:

     
    chmod 600 /etc/ssl/your-private.key
    chmod 644 /etc/ssl/your-certificate.crt /etc/ssl/your-ca-bundle.crt

Step 3: Install the SSL Certificate on Your Web Server

For Apache Web Server

  1. Open your Apache configuration file for the domain:

     
    nano /etc/apache2/sites-available/your-domain.conf
  2. Locate the <VirtualHost> block for your domain and update it with the following:

     
    <VirtualHost *:443>
        ServerAdmin webmaster@your-domain.com
        ServerName your-domain.com
        DocumentRoot /var/www/your-domain
    
        SSLEngine on
        SSLCertificateFile /etc/ssl/your-certificate.crt
        SSLCertificateKeyFile /etc/ssl/your-private.key
        SSLCertificateChainFile /etc/ssl/your-ca-bundle.crt
    
        <Directory /var/www/your-domain>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
  3. Save the file and exit the editor.

  4. Enable the SSL module and the site configuration:

     
    a2enmod ssl
    a2ensite your-domain.conf
  5. Restart Apache to apply the changes:

     
    systemctl restart apache2

For Nginx Web Server

  1. Open your Nginx configuration file for the domain:

     
    nano /etc/nginx/sites-available/your-domain
  2. Update the server block with the following:

     
    server {
        listen 443 ssl;
        server_name your-domain.com;
    
        ssl_certificate /etc/ssl/your-certificate.crt;
        ssl_certificate_key /etc/ssl/your-private.key;
        ssl_trusted_certificate /etc/ssl/your-ca-bundle.crt;
    
        root /var/www/your-domain;
        index index.html index.htm;
    
        location / {
            try_files $uri $uri/ =404;
        }
    }
  3. Save the file and exit the editor.

  4. Test the Nginx configuration for errors:

    bash
    Copy
    sudo nginx -t
  5. Restart Nginx to apply the changes:

    bash
    Copy
    sudo systemctl restart nginx

Step 4: Verify the SSL Installation

  1. Visit your website using https://your-domain.com in a web browser.

  2. Check for the padlock icon in the address bar to confirm the SSL certificate is working.

  3. Use an online SSL checker tool (e.g., SSL Labs) to verify the installation and ensure there are no issues.


Step 5: Redirect HTTP to HTTPS (Optional)

To ensure all traffic uses HTTPS, set up a redirect from HTTP to HTTPS.

For Apache

  1. Open your Apache configuration file for the domain:

    bash
    Copy
    nano /etc/apache2/sites-available/your-domain.conf
  2. Add the following redirect rule inside the <VirtualHost *:80> block:

     
    <VirtualHost *:80>
        ServerName your-domain.com
        Redirect permanent / https://your-domain.com/
    </VirtualHost>
  3. Save the file and restart Apache:

     
    systemctl restart apache2

For Nginx

  1. Open your Nginx configuration file for the domain:

     
    nano /etc/nginx/sites-available/your-domain
  2. Add the following server block for HTTP:

     
    server {
        listen 80;
        server_name your-domain.com;
        return 301 https://$host$request_uri;
    }
  3. Save the file and restart Nginx:

     
    systemctl restart nginx

Troubleshooting

  • SSL Not Working: Double-check the file paths and permissions in your web server configuration.

  • Mixed Content Warnings: Ensure all resources (images, scripts, etc.) on your website are loaded over HTTPS.

  • Certificate Expiry: Set a reminder to renew the SSL certificate before it expires.


By following this guide, you should be able to successfully install and configure your SSL certificate on your Linux server. If you encounter any issues, contact your hosting provider or SSL issuer for further assistance.


Share via
Did you find this article useful?  

Related Articles

Tags

© Rackzar