All pastes #534173 Raw Edit

apache2-ssl-certificate

public shellscript v1 · immutable
·published 2007-06-03 18:13 UTC
rendered paste body
#!/bin/sh -eif [ "$1" != "--force" -a -f /etc/apache2/ssl/apache.pem ]; then  echo "/etc/apache2/ssl/apache.pem exists!  Use \"$0 --force.\""  exit 0fiif [ "$1" = "--force" ]; then  shiftfi     echoecho creating selfsigned certificateecho "replace it with one signed by a certification authority (CA)"echoecho enter your ServerName at the Common Name promptechoecho If you want your certificate to expire after x days call this programm echo with "-days x" # use special .cnf, because with normal one no valid selfsigned# certificate is createdexport RANDFILE=/dev/randomopenssl req $@ -config /usr/share/apache2/ssleay.cnf \  -new -x509 -nodes -out /etc/apache2/ssl/apache.pem \  -keyout /etc/apache2/ssl/apache.pemchmod 600 /etc/apache2/ssl/apache.pemln -sf /etc/apache2/ssl/apache.pem \  /etc/apache2/ssl/`/usr/bin/openssl \  x509 -noout -hash < /etc/apache2/ssl/apache.pem`.0