Created
December 10, 2014 00:00
-
-
Save alfrekjv/c1dcc1dfb31182385a46 to your computer and use it in GitHub Desktop.
Generate SSL Cert Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir /etc/httpd/ssl | |
cd /etc/httpd/ssl | |
echo -e "Enter your virtual host FQDN: \nThis will generate the default name for Apache SSL Certificate and Key!" | |
read cert | |
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out $cert.key | |
chmod 600 $cert.key | |
openssl req -new -key $cert.key -out $cert.csr | |
openssl x509 -req -days 365 -in $cert.csr -signkey $cert.key -out $cert.crt | |
echo -e " The Certificate and Key for $cert has been generated!\nPlease link it to Apache SSL available website!" | |
ls -all /etc/httpd/ssl | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment