Advertisement
Justman10000

acme.sh

Jun 7th, 2023 (edited)
1,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.99 KB | None | 0 0
  1. // To install
  2. mkdir /home/acme.sh
  3. cd /home/acme.sh
  4. git init
  5. git remote add origin https://github.com/acmesh-official/acme.sh
  6. git pull origin master
  7. rm -r .* *.md Dockerfile
  8. chmod -R 777 .
  9. bash *.sh --install --cert-home /etc/letsencrypt/archive
  10. mkdir /etc/letsencrypt
  11. mkdir /etc/letsencrypt/live
  12.  
  13. ## Now shut down Apache2
  14. systemctl stop apache2
  15.  
  16. domain=MY_DOMAIN # Replace MY_DOMAIN with your domain
  17. eccdomain=MY_DOMAIN_ecc # Replace only MY_DOMAIN with your domain
  18.  
  19. mkdir /etc/letsencrypt/live/$domain
  20.  
  21. # Getting certs
  22. ## Standalone (Syntax: domain.tld) (Includes only the main domain, no subdomains) (Requires no domain authendification)
  23. bash /home/acme.sh/acme.sh --server letsencrypt --issue --domain $domain --standalone \
  24.     --cert-file /etc/letsencrypt/live/$domain/cert.pem \
  25.     --key-file /etc/letsencrypt/live/$domain/privkey.pem \
  26.     --fullchain-file /etc/letsencrypt/live/$domain/fullchain.pem
  27. ## Wildcard (Syntax: *.domain.tld) (Includes only subdomains, not the main domain) (Requires domain authendification)
  28. bash /home/acme.sh/acme.sh --server letsencrypt --issue --domain *.$domain --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please \
  29.     --cert-file /etc/letsencrypt/live/$domain/cert.pem \
  30.     --key-file /etc/letsencrypt/live/$domain/privkey.pem \
  31.     --fullchain-file /etc/letsencrypt/live/$domain/fullchain.pem
  32.  
  33. # Renew certs
  34. ## Wildcard
  35. bash /home/acme.sh/acme.sh --server letsencrypt --renew --domain *.$domain --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please
  36.  
  37. ## For renewing domains after requesting for wildcards
  38. cp /etc/letsencrypt/archive/*.$eccdomain/*.$domain.cer /etc/letsencrypt/live/$domain/cert.pem
  39. cp /etc/letsencrypt/archive/*.$eccdomain/*.$domain.key /etc/letsencrypt/live/$domain/privkey.pem
  40. cp /etc/letsencrypt/archive/*.$eccdomain/fullchain.cer /etc/letsencrypt/live/$domain/fullchain.pem
  41.  
  42. ## Now that the certificate(s) have been requested, restart Apache2:
  43. systemctl start apache2
  44.  
  45. // To uninstall
  46. rm -r /home/acme.sh /root/.acme.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement