To secure connections on your server, it is essential to install an SSL certificate on your Apache server. Doing this ensures that all communication between VergeCloud and your backend infrastructure is encrypted, protected from interception, and safe from tampering. When SSL is configured correctly, both the integrity and confidentiality of the data flowing through your environment are maintained, which is especially important for applications handling user information, authentication, API communication, or internal services that must remain private. Setting up SSL is not only a good practice; in many environments it has become a requirement to meet compliance standards and security guidelines
After obtaining your certificate and private key, upload both files to a secure directory on your server. A commonly used directory structure would look like this:
/etc/ssl/vergecloud/certificate.crt
/etc/ssl/vergecloud/private.key
Make sure the directory you choose is protected and not accessible by unauthorized users. Using a consistent and clear folder structure helps avoid confusion during configuration changes or certificate renewals. When transferring the files from your local machine to the server, use secure methods such as SCP or SFTP. Avoid uploading sensitive certificate files through unsecured web interfaces, public file-sharing tools, or any environment that might expose them to unauthorized access.
To ensure all incoming traffic uses HTTPS, configure an HTTP virtual host that forces a redirect. This prevents users from accidentally accessing the unencrypted version of your site. Add the following virtual host to your Apache configuration:
This redirect ensures that even if a visitor enters the HTTP version of your domain or if an old link pointing to HTTP still exists somewhere, all traffic will automatically be routed to the secure HTTPS site.
Next, update your existing SSL virtual host file or create a new one, typically stored at:
/etc/apache2/sites-available/yourdomain-ssl.conf
Inside this file, add the following configuration:
After completing your configuration changes, enable the SSL module, enable the site configuration, and reload Apache:
sudo a2enmod ssl
sudo a2ensite yourdomain-ssl.conf
sudo systemctl reload apache2
If any syntax errors exist in your configuration, Apache will warn you so you can correct them before applying changes.
To test your SSL setup and confirm that the certificate is being served correctly, run:
openssl s_client -connect yourdomain.com:443
This command displays certificate details, helps you confirm that the correct certificate is loaded, and checks that the SSL handshake completes without issues.