Friday, August 6, 2010

enable tomcat https

#! /bin/sh
KEYTOOL=/usr/java/jdk1.6.0_11/bin/keytool

echo "check keytool"
if [ -e $KEYTOOL ]
then
  echo "JDK keytool found."
else
  echo "/usr/java/jdk1.6.0_11/bin/keytool not found"
  exit
fi


echo "install tomat ssl self-signed certificate"
sudo $KEYTOOL -genkey -alias tomcat -keyalg RSA -keystore ntr_new.jks  -storepass changeit -keypass changeit  -dname "CN=Greg Smith, OU=GF, O=AMP, L=Mountain, ST=VA, C=US" -validity 360

sudo rm /opt/tomcat/ntr.jks
sudo cp ntr_new.jks /opt/tomcat/ntr.jks
sudo rm -f ntr_new.jks

No comments:

Post a Comment