SSL

Install SSL on Apache Standalone VPS (Centos)

This guide will guide you how to install SSL on server that using Apache Standalone VPS (not using cPanel or Plesk or any control panel hosting), especially Centos server. For ubuntu, there might be some slight changes. But basically has same concept configuration. Before go further, may check with customer first see if they install some Opensource hosting control panel or no.

Copy the Cert

First thing to do is copy the cert, key ana CA crt if available. Make sure you did not leave any blank characters while copying the files.

mkdir -p /etc/ssl/private
chmod 700 /etc/ssl/private

Make sure you have :

  • certificate.crt
  • private.key
  • ca.crt

Next, we go to configurations.

Configure the SSL conf

The default configuration stored within this conf path.

/etc/httpd/conf.d/ssl.conf

Backup the conf, make sure we don’t mess up everything.

cp -p /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf-BAK

Then modify the necessary things as follows. REMEMBER it is for modify only, not adding new lines.

<VirtualHost *:443>
DocumentRoot /var/www/path/
ServerName domain:443
SSLEngine on
SSLCertificateFile /etc/ssl/private/certificate.crt
SSLCertificateKeyFile /etc/ssl/private/private.key
SSLCACertificateFile /etc/ssl/private/ca.crt
</VirtualHost>

Restart the Apache

Last, we need to restart the Apache for SSL changes.

service httpd restart

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *