In this article, we will go over the step-by-step instructions on how to install the SSL certificate on the Apache Web Server for CentOS 8.
Please make sure that which version you are using as the process slightly differs.
Kindly note: in order to complete the installation successfully, you will need to access the CentOS server as a non-root user with sudo privileges, as well as you will need to have the Apache web server installed.

Before we start reviewing the certificate installation process, let’s highlight some points that need to be done before installation. You will need to:
- Place the order in the CheapSSLSecurity Client Area
- Generate a key pair (CSR and Private Key)
- Pass the verification and get the certificate issued
- Download the certificate files
Not sure which type of SSL certificate to obtain? The CheapSSLSecurity Sales Team is always glad to listen to all your wishes and requirements and find the most suitable solution.
Here you may compare features and prices of our products:
https://cheapsslsecurity.com/sslcompare/compare-ssl-certificates-prices.html
To contact our Sales Team:
https://cheapsslsecurity.com/support/sslsupport.html#submitticket
Once the product is selected, you may need to generate a CSR (Certificate Signing Request) and a Private Key.
You may use the online tools as CheapSSLSecurity CSR Generator, or generate the key pair directly on the server. Let’s take a look at this process.
CSR and Private Key Generation
Step 1: Connect to Your Server
Start by accessing your server’s terminal using Secure Shell (SSH). This will allow you to run commands directly on the server.
Step 2: Create Private Key and CSR
Please use the OpenSSL tool to generate your Private Key and CSR files. Type the following command:
IMPORTANT! Make sure to replace example with your actual domain name.
Step 3: Enter Certificate Information
After running the command, you will be prompted to input details for your certificate.
- Country Name: Enter the two-letter country code (for example, IT for Italy).
- State or Province Name: Full name of your state or region.
- Locality Name: Your city or town’s name.
- Organization Name: The company’s legal name.
- Organizational Unit Name: Typically “IT” or “Web Administration”.
- Common Name: Your Fully Qualified Domain Name (FQDN).
- Email Address: Enter a valid email address.
IMPORTANT! The optional fields, such as Challenge Password, may be left blank.
Step 4: Generate Files
After completing the prompts, OpenSSL will create two files:
- Private Key File (.key file): Please save the Private Key as you will need it later for the certificate installation.
- CSR (.csr file): You will need to submit it to the vendor to proceed with the certificate generation.
To check if the CSR was created correctly, you can view its contents with the following command:
This will display the CSR details and confirm its validity.
Please submit the CSR to the vendor via the order page in the CheapSSLSecurity Client Area and proceed with the order verification.
Here you may check more detailed information regarding the order validation process
https://knowledge.cheapsslsecurity.com/support/solutions/folders/22000164534
Once the verification is completed and the SSL is issued, please download the certificate files and proceed with the installation.
SSL Installation on CentOS 8
Step 1: Verify and Install mod_ssl on Your System
Begin by executing the following command to determine if mod_ssl is already installed on your system.
If it appears that mod_ssl is not present, proceed with the installation using this command:
Step 2: Upload the SSL files
Create the combined file that will include the Private Key, which was generated together with CSR as a pair and should be saved on your own, your SSL certificate, Intermediate, and Root certificates, which are provided by the vendor. To create the combined file, run this command:
Next, navigate to your Apache server and store the PEM file along with the SSL chain in the following directory:
The Private Key should be saved it in this directory:
To ensure that your Private Key is secure and not accessible to unauthorized users, apply this command:
Step 3: Apache configuration
If the configuration file for your domain has not been created, you will need to create one.
Save it in /etc/httpd/conf.d/ directory. The file should be created with the .conf extension.
You may use the following configuration:
SSLEngine on
# The path to the complete chain of your SSL certificate
SSLCertificateFile /etc/pki/tls/certs/full-chain.pem
# The path to the Private Key
SSLCertificateKeyFile /etc/pki/tls/private/privkey.pem
# The path to the content of your website.
AllowOverride All
# The path to the content of the website
DocumentRoot /var/www/example.tld.
# Domain name of your website
ServerName example.tld.
ServerAlias www.example.tld.
IMPORTANT! Be sure to replace ‘example.tld’ with your actual domain name.
IMPORTANT! Remember to close the file and save all modifications before exiting.
Step 4: Restart Apache and Finalize Setup
To apply your changes and restart the Apache server, execute this command:
If the server restarts without any issues, your installation process is now complete.
Conclusion
If you have successfully completed these 4 simple steps, your certificate is installed.
You can check if it works properly using our SSL Checker:
Please refer to our Knowledgebase if you need any additional information, as well as you are always welcome to contact our Support Team: https://knowledge.cheapsslsecurity.com/support/solutions
For the CentOS 6 and CentOS 7 SSL installation manual, kindly refer to this manual.
