Install GoDaddy SSL Certificate on Apache

You need 4 files:

  • Certificate Signig Request (CSR), example.com.csr
  • Private Key, example.com.key
  • SSL Certificate, example.com.crt (GoDaddy: 7dbXXXXXXXXfef89.crt)
  • Intermediate Certificate, example.com.crt or intermediate.crt or chainfile.crt (GoDaddy: gd_bundle-g2-g1.crt)
<VirtualHost 192.168.0.1:443>
		DocumentRoot /var/www/html2
		ServerName www.yourdomain.com
		    SSLEngine on
		    SSLCertificateFile /path/to/your_domain_name.crt
		    SSLCertificateKeyFile /path/to/your_private.key
		    SSLCertificateChainFile /path/to/DigiCertCA.crt
</VirtualHost>

CSR

Generate a CSR (Certificate Signing Request) Key. Don’t add a passphrase, if you do it’ll ask you for the passphrase everytime you restart Apache.

openssl req -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr
  • -new used when creating a new CSR, rather than processing an existing one
  • -key the name of the file containing the key pair
  • -out name of the file to receive the CSR

You can use this CSR Decoder by GoDaddy to check your CSR

Generating a 2048 bit RSA private key
..............................+++
.................................+++
writing new private key to 'example.com.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:England
Locality Name (eg, city) []:London
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example Ltd.
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:example.com
Email Address []:info@example.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
-----BEGIN CERTIFICATE REQUEST-----
MIICzTCCAbUCAQAwgYcxCzAJBgNVBAYTAkdCMRYwFAYDVQQIEw1TdGFmZm9yZHNo
aXJlMRcwFQYDVQQHEw5TdG9rZSBvbiBUcmVudDEjMCEGA1UEChMaUmVkIEtlc3Ry
ZWwgQ29uc3VsdGluZyBMdGQxIjAgBgNVBAMTGXRlc3RjZXJ0LnJlZGtlc3RyZWwu
Y28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWLeW88IeAIa3n
23R99i874fh0jetf+STsGPgkfGXGJ++tclKGk3MJE0ijD4PNaxGXUCNULgn2ROyy
bm5sTmGzpEOD+1AAAyV+pLQoFNkHEFuudGqVM6XkPWfqaM2vKvdzUbPPC0X/MfDF
GPxc8AY3TUM385c9c9/WOIF6NUcAvAFIQF0zG7evzJZBqDb4enUnatMSLHmxRWMi
1JeHtfLINXhNitHewEQWgIB3j1xmh7CPO5FeTb6HzQDxc+f7uMisY6s9J/Ph3GeO
CeIDooqU8jnfV5eGEzIMH5CFMZjajrNKF4DYK3YRyUI0K66+v0KILoUntEs++M20
LhOn+VE9AgMBAAGgADANBgkqhkiG9w0BAQUFAAOCAQEAUWE7oBX3SLjYNM53bsBO
lNGnsgAp1P1fiCPpEKaZGEOUJ2xOguIHSu1N1ZigKpWmiAAZxuoagW1R/ANM3jXp
vCLVBRv40AHCFsot9udrdCYjI43aDHAaYvLmT4/Pvpntcn0/7+g//elAHhr9UIoo
MZwwwo6yom67Jwfw/be/g7Mae7mPHZ2lsQTS02hEeqVynIRk2W9meQULrt+/atog
0mqJSBx0WswtHliTc+nXFpQrwFIEzVuPGCOVw7LmCfNmHNCkZVuRSJB/9MdLmrfw
chPI3NeTGSe+BZfsOtpt2/7j+bqeYKFu8B0stLoJBEnihxUoV18uZOmOeuVuX1N6
-----END CERTIFICATE REQUEST-----

Private Key (SSLCertificateKeyFile)

Private Key SSLCertificateKeyFile (.key file generated when you cerated the CSR)

-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEArFygrFCXyihuVVYCbdBEvKn64wiYX7B5C4YG/E3OwCbXa7n+
x8ObV4jJnqwZsHH1SG2I1e3HCkOfJJwQSVX3rKHBLZW855XbQbatqpoZAfhrTC6p
xamp4ECqnPLjU2YGs8QjV1MVlV7xYHulFpOvhJFB9ULcEHa+DjhS6wggk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ADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
ReYNnyicsbkqWletNw+vHX/bvZ8=
-----END CERTIFICATE-----

Change/Remove the passphrase

openssl rsa -des3 -in myserver.key -out server.key.new
mv server.key.new myserver.key

Apache Conf file

# domain: example.com
# public: /var/www/example.com/public_html/
# logs: /var/www/example.com/logs/

<VirtualHost *:443>

  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName example.com
  #ServerAlias www.example.com

  SSLEngine on
  SSLCertificateFile /etc/apache2/cert/example.com.crt
  SSLCertificateKeyFile /etc/apache2/cert/example.com.key
  SSLCertificateChainFile /etc/apache2/cert/example.com.chainfile.crt
  <IfVersion >= 2.4.8 >
    SSLCACertificateFile /etc/apache2/cert/example.com.chainfile.crt
  </IfVersion>

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php index.html
  DocumentRoot /var/www/example.com/public_html

  # Allow .htaccess and Rewrites
  <Directory /var/www/example.com/public_html>
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  # Log file locations
  LogLevel warn
  ErrorLog /var/www/example.com/logs/error.log
  CustomLog /var/www/example.com/logs/access.log combined

  # Custom php.ini path
  # PHPINIDir /var/www/example.com/public_html/
</VirtualHost>

<VirtualHost *:80>
  ServerName example.com

  # Redirect all HTTP to HTTPS
  Redirect permanent / https://example.com/
</VirtualHost>