BASH   16

apache2 ssl key certificate ubuntu sh

Guest on 15th May 2022 04:31:17 PM

  1. #!/bin/bash
  2. if [ -z "$1" ];
  3. then
  4.   echo
  5.   echo Usage: $0 [domainname]
  6.   echo
  7. exit
  8. fi
  9.  
  10. server=$1
  11. path=/etc/apache2/ssl
  12. mkdir -p $path
  13.  
  14. openssl genrsa -des3 -out $path/$server.key 2048
  15. openssl rsa -in $path/$server.key -out $path/$server.key.insecure
  16. openssl req -new -key $path/$server.key.insecure -out $path/$server.csr
  17.  
  18. echo
  19. echo $path/$server.key
  20. echo $path/$server.csr
  21. echo
  22. echo SSLCertificateFile $path/$server.crt
  23. echo SSLCertificateKeyFile $path/$server.key

Raw Paste


Login or Register to edit or fork this paste. It's free.