Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hannesbe/c4444056f0d7947584828af6427ac1f4 to your computer and use it in GitHub Desktop.
Save hannesbe/c4444056f0d7947584828af6427ac1f4 to your computer and use it in GitHub Desktop.
SSL certificate installation script for Spalder reverse-proxy servers
#!/usr/bin/env bash
certname="multidomain-www.snowplaza.nl-2019"
download="https://c.connexeon.com/s/oArzonTLRJknMLS/download"
apt-get update
apt-get upgrade -y
apt-get install unzip lnav glances -y
rm -f $certname.zip
rm -rf $certname/
wget $download
mv download $certname.zip
unzip $certname.zip
cd $certname/
rm -f /etc/ssl/certs/$certname.crt
rm -f /etc/ssl/private/$certname.private.key
mkdir /etc/nginx/ssl
rm -f /etc/nginx/ssl/nginx.crt
rm -f /etc/nginx/ssl/nginx.key
cat $certname.cer $certname-CA.cer > /etc/ssl/certs/$certname.crt
cp $certname.private.key /etc/ssl/private/
ln -s /etc/ssl/certs/$certname.crt /etc/nginx/ssl/nginx.crt
ln -s /etc/ssl/private/$certname.private.key /etc/nginx/ssl/nginx.key
service nginx restart
service apache2 restart
service varnish restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment