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.
Purchased SSL Certificate: Ensure the SSL certificate has been issued and is ready for use.
Access to WHMCS Client Area: You must have login credentials for the WHMCS client area.
Server Access: Root or sudo access to your Linux server (Ubuntu or other distributions).
Web Server Software: Apache or Nginx installed on your server.
Domain Configuration: The domain for which the SSL certificate is issued must be properly configured and pointing to your server.
Log in to your WHMCS client area.
Navigate to Services > My Services.
Locate the service associated with your SSL certificate and click on it.
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.
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/
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
Open your Apache configuration file for the domain:
nano /etc/apache2/sites-available/your-domain.conf
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>
Save the file and exit the editor.
Enable the SSL module and the site configuration:
a2enmod ssl a2ensite your-domain.conf
Restart Apache to apply the changes:
systemctl restart apache2
Open your Nginx configuration file for the domain:
nano /etc/nginx/sites-available/your-domain
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; } }
Save the file and exit the editor.
Test the Nginx configuration for errors:
sudo nginx -t
Restart Nginx to apply the changes:
sudo systemctl restart nginx
Visit your website using https://your-domain.com
in a web browser.
Check for the padlock icon in the address bar to confirm the SSL certificate is working.
Use an online SSL checker tool (e.g., SSL Labs) to verify the installation and ensure there are no issues.
To ensure all traffic uses HTTPS, set up a redirect from HTTP to HTTPS.
Open your Apache configuration file for the domain:
nano /etc/apache2/sites-available/your-domain.conf
Add the following redirect rule inside the <VirtualHost *:80>
block:
<VirtualHost *:80> ServerName your-domain.com Redirect permanent / https://your-domain.com/ </VirtualHost>
Save the file and restart Apache:
systemctl restart apache2
Open your Nginx configuration file for the domain:
nano /etc/nginx/sites-available/your-domain
Add the following server block for HTTP:
server { listen 80; server_name your-domain.com; return 301 https://$host$request_uri; }
Save the file and restart Nginx:
systemctl restart nginx
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.