You need 4 files:
example.com.csr
example.com.key
example.com.crt
(GoDaddy: 7dbXXXXXXXXfef89.crt
)example.com.crt
or intermediate.crt
or chainfile.crt
(GoDaddy: gd_bundle-g2-g1.crt
)1<VirtualHost 192.168.0.1:443>
2 DocumentRoot /var/www/html2
3 ServerName www.yourdomain.com
4 SSLEngine on
5 SSLCertificateFile /path/to/your_domain_name.crt
6 SSLCertificateKeyFile /path/to/your_private.key
7 SSLCertificateChainFile /path/to/DigiCertCA.crt
8</VirtualHost>
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.
1openssl 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 CSRYou 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
(.key file generated when you cerated the CSR)
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEArFygrFCXyihuVVYCbdBEvKn64wiYX7B5C4YG/E3OwCbXa7n+
x8ObV4jJnqwZsHH1SG2I1e3HCkOfJJwQSVX3rKHBLZW855XbQbatqpoZAfhrTC6p
xamp4ECqnPLjU2YGs8QjV1MVlV7xYHulFpOvhJFB9ULcEHa+DjhS6wggkU9qswDI
XpE+YS6HF86hSZll/jV6oLkmUaX3RxFTdInWnnJXNvn19H6r7MbEfsEh491jIwKO
CzKg+DggMJJlDKgRAv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qdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
ReYNnyicsbkqWletNw+vHX/bvZ8=
-----END CERTIFICATE-----
1openssl rsa -des3 -in myserver.key -out server.key.new
2mv server.key.new myserver.key
1# domain: example.com
2# public: /var/www/example.com/public_html/
3# logs: /var/www/example.com/logs/
4
5<VirtualHost *:443>
6
7 # Admin email, Server Name (domain name), and any aliases
8 ServerAdmin webmaster@example.com
9 ServerName example.com
10 #ServerAlias www.example.com
11
12 SSLEngine on
13 SSLCertificateFile /etc/apache2/cert/example.com.crt
14 SSLCertificateKeyFile /etc/apache2/cert/example.com.key
15 SSLCertificateChainFile /etc/apache2/cert/example.com.chainfile.crt
16 <IfVersion >= 2.4.8 >
17 SSLCACertificateFile /etc/apache2/cert/example.com.chainfile.crt
18 </IfVersion>
19
20 # Index file and Document Root (where the public files are located)
21 DirectoryIndex index.php index.html
22 DocumentRoot /var/www/example.com/public_html
23
24 # Allow .htaccess and Rewrites
25 <Directory /var/www/example.com/public_html>
26 Options FollowSymLinks
27 AllowOverride All
28 </Directory>
29
30 # Log file locations
31 LogLevel warn
32 ErrorLog /var/www/example.com/logs/error.log
33 CustomLog /var/www/example.com/logs/access.log combined
34
35 # Custom php.ini path
36 # PHPINIDir /var/www/example.com/public_html/
37</VirtualHost>
38
39<VirtualHost *:80>
40 ServerName example.com
41
42 # Redirect all HTTP to HTTPS
43 Redirect permanent / https://example.com/
44</VirtualHost>