Created
April 4, 2016 23:26
-
-
Save thedoc31/bb37253f092136cb35a99ab309de6beb to your computer and use it in GitHub Desktop.
Function for .bashrc which takes a commandline param of a name for an SSL cert, creates the right folder for it under /etc/httpd/conf.d and runs openssl with the right parameters to create the csr and key file.
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
newcsr() { | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: newcsr www.my.sitename"; return | |
fi | |
mkdir /etc/httpd/conf.d/"$1".ssl | |
cd /etc/httpd/conf.d/"$1".ssl | |
openssl req -new -newkey rsa:2048 -nodes -out "$1".csr -keyout "$1".key | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment