PDA

View Full Version : How do I install a SSL Certificate on my VPS? (without cPanel)



Max
January 19th, 2012, 12:47 PM
If you are NOT running cPanel on your VPS (for advanced users):


Create the following directories if they don't exist:
/etc/ssl/certs -- used to store the certificate files
/etc/ssl/private -- used to store the private keys
To create these directories run:

mkdir /etc/ssl
mkdir /etc/ssl/certs
mkdir /etc/ssl/private
chmod 700 /etc/ssl/private
copy the certificate file to /etc/ssl/certs
copy the key file to /etc/ssl/private
edit the apache configuration file, normally it's in this location:

/etc/httpd/conf/httpd.conf
create a virtual host for your site by adding the following section to your apache configuration file:


<VirtualHost 123.123.123.123:443>
ServerName domain.com
ServerAlias www.domain.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/cert_file.crt
SSLCertificateKeyFile /etc/ssl/private/key_file.key
SSLCACertificateFile /etc/ssl/certs/intermediate_cert_file.cabundle
<Directory /var/www/html/>
AllowOverride All
</Directory>
DocumentRoot /var/www/html/
SSLProtocol +SSLv3 +TLSv1
SSLCipherSuite RSA:!EXP:!NULL:+HIGH:-MEDIUM:-LOW
</VirtualHost>
Replace 123.123.123.123 with your static IP for this site. Change domain.com and www.domain.com to your domain name. Adjust the cert and key file names to what you have named them. Set your document root to the location of your site.
Save the file and restart apache
If you have any errors in your httpd.conf apache will let you know when you attempt to restart.