Securing your CentOS 7 server with an SSL certificate ensures encrypted data transfer and builds trust with your users. In this step-by-step guide, we’ll cover two approaches to install an SSL certificate on CentOS 7 using Apache HTTP server (httpd):
- The manual method
- The automated method using GeoTrust Horizon’s AutoInstall SSL.
Automate Your SSL Certificate in 5 Minutes
Keep your website secure and online… no manual certificate renewals needed!
Requirements Before You Begin
- A CentOS 7 server with the Apache HTTP server (httpd) installed
- Root or sudo privileges
- A valid SSL/TLS certificate from a publicly trusted certificate authority (CA)
Don’t Have an SSL Certificate?
No worries — you can get one from us at some of the best prices on the internet.
Method 1: Manual Installation on Apache (CentOS 7)
Step 1: Generate a CSR and Private Key for Your Domain
If you haven’t already, generate a certificate signing request (CSR) and private key using OpenSSL:
openssl req -new -newkey rsa:2048 -nodes -keyout securitytest_site.key -out securitytest_site.csr
Follow the prompts to enter your domain details.

Step 2: Upload the CSR to GeoTrust Horizon and Complete Validation
This next step involves sending your certificate signing request to your certificate provider. If you’ve purchased a certificate from us, you can submit the CSR via the GeoTrust Horizon dashboard.
- Log in to GeoTrust Horizon platform dashboard.
- Click Add Domain and upload your .csr file.

- Select a method of domain control validation (ideally, using DNS or HTTP file-based methods).

Once the domain is verified, download the issued certificate bundle, which includes:
- Domain certificate: For example, securitytest_site.crt
- CA certificate bundle (intermediate chain): For example, My_CA_Bundle.ca-bundle
Step 3: Upload Your SSL Certificate and Key Files to the CentOS Server
Use scp (the secure copy protocol) or tools like WinSCP to transfer these files from your local system to the server. Use the following commands. (Note: Be sure to replace the example file names below with your unique file names.)
scp securitytest_site.crt ec2-user@your_server_ip:/home/ec2-user/
scp My_CA_Bundle.ca-bundle ec2-user@your_server_ip:/home/ec2-user/
scp security.test.site.key ec2-user@your_server_ip:/home/ec2-user/
Then move them into appropriate system directories using the following commands:
sudo mv securitytest_site.crt /etc/pki/tls/certs/
sudo mv My_CA_Bundle.ca-bundle /etc/pki/tls/certs/
sudo mv security.test.site.key /etc/pki/tls/private/
Set the correct permissions for the specified files:
sudo chmod 644 /etc/pki/tls/certs/*.crt
sudo chmod 600 /etc/pki/tls/private/*.key
Step 4: Create a FullChain File Required by Apache
Apache expects a complete certificate chain for proper SSL validation. Combine your domain certificate and CA bundle using the following command (again, replacing the generic values with your unique file names):
sudo bash -c 'cat /etc/pki/tls/certs/securitytest_site.crt /etc/pki/tls/certs/My_CA_Bundle.ca-bundle > /etc/pki/tls/certs/fullchain.pem'

Alternatively, if you’re running an older version of Apache and need to upload the separate files, you can do so using the following command:
SSLCertificateFile /etc/httpd/conf.d/yourdomain.crt
SSLCertificateChainFile /etc/httpd/conf.d/ca_bundle.ca-bundle
SSLCertificateKeyFile /etc/httpd/conf.d/private.key
Step 5: Update Apache Configuration to Use the SSL Certificate
To enable SSL in Apache2 CentOS 7, you must edit the Apache SSL configuration file:
sudo nano /etc/httpd/conf.d/ssl.conf
In it, replace or update the <VirtualHost *:443> block to include the specified SSLCertificateFile and SSLCertificateKeyFile information:
<VirtualHost *:443>
ServerName securitytest.site
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/fullchain.pem
SSLCertificateKeyFile /etc/pki/tls/private/security.test.site.key
ErrorLog /var/log/httpd/securitytest.site.error.log
CustomLog /var/log/httpd/securitytest.site.access.log combined
</VirtualHost>

Step 6: Check Apache Configuration for Syntax Errors
Run the following command to test your configuration file for any issues:
sudo apachectl configtest
Here’s what you should expect to see:
Syntax OK
Step 7: Restart Apache and Enable it on Boot
Restart your Apache server to apply the changes to its SSL configuration:
sudo systemctl restart httpd
Enable Apache to run at startup:
sudo systemctl enable httpd
Step 8: Verify HTTPS Access in a Browser
Once you’ve rebooted your web server, you’ll want to test your domain in a browser to see whether HTTPS is enabled. If it is, you should see a secure padlock icon in the address bar (depending on the browser) or a message stating that your connection is secure.

To troubleshoot, test SSL using:
openssl s_client -connect <website>:443 -servername <website>
Automate Your SSL Certificate in 5 Minutes
Keep your website secure and online… no manual certificate renewals needed!

Method 2: Automate SSL on CentOS 7 Using AutoInstall SSL
GeoTrust Horizon simplifies SSL deployment with an automated installation script for Apache. Here’s how to use it:
Step 1: Add Your Domain in GeoTrust Horizon
Log into GeoTrust Horizon, click Add Domain, and follow the prompts. This includes selecting Automatic Installation as your preferred method.

Step 2: Complete the CSR Generation and Domain Validation Processes
GeoTrust Horizon will walk you through the processes of generating a CSR and verifying your domain ownership (via DNS or file-based validation). To start the process, select your server type as shown below, as shown in the screenshot below:

Next, select your preferred method of domain control validation.

Step 3: Download and Run the Agent and Certificate Installation Script
Once verified, GeoTrust Horizon will generate a customized installation script that automatically:
- Installs the certificate,
- Creates and configures the SSL virtual host, and
- Restarts the Apache service.
To initiate this process, all you must do is enter the following command:
sudo wget -qO - https://files.autoinstallssl.com/packages/linux/version/latest/get.autoinstallssl.sh | sudo bash -s
To execute it, enter the following command, which will include your AutoInstall SSL token:
sudo runautoinstallssl.sh installcertificate --token <tokenvalue> --validationtype file --validationprovider filesystem


That’s it! This means you can set AutoInstall SSL up once and it’ll take care of these monotonous tasks for you from now on. As you can see, using AutoInstall SSL to install an SSL certificate on a CentOS 7 Apache server is fast and easy.
SSL automation gives you back time that can be spent on other tasks that require your human ingenuity, skills, and critical thinking.
Common Questions and Troubleshooting
Why does Apache return a ‘Failed to configure CA certificate chain’ message?
This error typically inicates one of the following issues:
- Your CA chain file is missing or incorrect
- The fullchain file (if you used one) is incomplete or misconfigured
Ensure the certificate and chain are properly combined as shown in Step 4.
Can I use a combined fullchain instead of separate files?
Yes! Doing so is recommended for modern Apache versions (although it’s not technically a requirement). Run:
sudo bash -c 'cat /etc/pki/tls/certs/securitytest_site.crt /etc/pki/tls/certs/My_CA_Bundle.ca-bundle > /etc/pki/tls/certs/fullchain.pem'
Then update your Apache configuration:
SSLCertificateFile /etc/pki/tls/certs/fullchain.pem
You can remove SSLCertificateChainFile if using the fullchain.
What if my browser says the site is still “Not Secure”?
Try the following:
- Clear browser cache or test in Incognito
- Review your Apache logs: sudo tail -n 30 /var/log/httpd/securitytest.site.error.log
- Use openssl s_client to verify the SSL chain
Tips for Managing and Renewing SSL on CentOS
- Renew your SSL/TLS certificate 30 days before it’s set to expire.
- Use GeoTrust Horizon’s auto-renew feature to avoid manual reconfiguration.
- Back up your .crt, .key, and .pem files securely.
- Monitor your SSL/TLS status using an online tool, such as GeoTrust Horizon’s SSL Monitor