Skip to content

Instantly share code, notes, and snippets.

@mgrouchy
Created August 15, 2010 01:02
Show Gist options
  • Save mgrouchy/524908 to your computer and use it in GitHub Desktop.
Save mgrouchy/524908 to your computer and use it in GitHub Desktop.
#first generate a key for your domain
openssl genrsa -out yourdomain.com.key 2048
#then generate the request
openssl req -new -key yourdomain.com.key -out yourdomain.com.csr
#if you want to remove the password from your certificate so its
#not required on webserver restart(optional)
mv yourdomain.com.key yourdomain.com.passkey
sudo openssl rsa -in yourdomain.com.passkey -out yourdomain.com.key
#if on nginx prepare your certificate by combining the two files given to
#you by godaddy
cat yourdomain.com.crt gd_bundle.crt > yourdomain.com_combined.crt
#your nginx config for your server on port 443 will contain
ssl on;
ssl_certificate /ssl_location/yourdomain.com_combined.crt;
ssl_certificate_key /ssl_location/yourdomain.com.key;
#if you are on apache your apache config should look like this
#unlike nginx apache allows you to specify a Certificate chain
#file so you don't have to combine your certificates to make them
#appear correctly in all browsers.
SSLEngine On
SSLCertificateFile /ssl_location/yourdomain.com.crt
SSLCertificateKeyFile /ssl_location/yourdomain.com.key
SSLCertificateChainFile /ssl_location/gd_bundle.crt
@mgrouchy
Copy link
Author

test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment