Skip to content

Instantly share code, notes, and snippets.

@superbiche
Last active September 2, 2018 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superbiche/f7c0133116cea3911a50425315f4c2fb to your computer and use it in GitHub Desktop.
Save superbiche/f7c0133116cea3911a50425315f4c2fb to your computer and use it in GitHub Desktop.
Copy SSL certificate to vhost
#!/bin/bash
## BE CAREFUL as the "web" directory is not accessible from outside in my setup, you should NEVER put your certs in a web accessible location
mkdir -p /var/www/.../web/ssl
## BE CAREFUL as the "web" directory is not accessible from outside in my setup, you should NEVER put your certs in a web accessible location
cp -afLr /etc/letsencrypt/live/.../privkey.pem /var/www/.../web/ssl/server.key
## BE CAREFUL as the "web" directory is not accessible from outside in my setup, you should NEVER put your certs in a web accessible location
cp -afLr /etc/letsencrypt/live/.../fullchain.pem /var/www/.../web/ssl/server.crt
chown -R web5:web5 /var/www/.../web/ssl
chmod 700 /var/www/.../web/ssl
chmod 400 /var/www/.../web/ssl/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment