1. tomcat-vault 세팅
cp tomcat-vault.jar $SERVER_HOME(엔진)/lib/
cd $CATALINA_BASE(인스턴스)/bin
vi tomcat-vault.sh
...
2. export JAVA_OPTS 세팅
cd $CATALINA_BASE/bin
vi env.sh
...
JAVA_OPTS="${JAVA_OPTS} -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.vault.util.PropertySourceVault"
...
3. server.xml 세팅
cd $CATALINA_BASE/conf/
vi server.xml
...
password=${VAULT::rp_enc::mariadb_password::}
...
4. enc_db.sh
#!/bin/bash
BASEDIR=$(dirname "$0")
. $BASEDIR/env.sh
USERNAME=$1
PASSWD=$2
keytool -genseckey -keystore $CATALINA_BASE/conf/vault.keystore -alias rp_vault -storetype jceks -keyalg AES -keysize 128 -storepass rplinux123$ -keypass rplinux123$
if [ e$USERNAME == "e" ];
then
echo " input DB USER NAME ....."
echo " ex ) ./enc_db.sh \"DB USER NAME\" \"DB Password\""
exit 1
elif [ e$PASSWD == "e" ];
then
echo " input DB Password ....."
echo " ex ) ./enc_db.sh \"DB USER NAME\" \"DB Password\""
exit 1
else
echo " \"DB USER NAME=$USERNAME\" \"DB Password=$PASSWD\""
fi
$CATALINA_BASE/bin/tomcat-vault.sh --keystore $CATALINA_BASE/conf/vault.keystore --keystore-password rplinux123$ --alias rp_vault --enc-dir $CATALINA_BASE/conf/ --iteration 120 --salt rock_enc --vault-block rp_enc --attribute mariadb_password --sec-attr "$PASSWD" | grep "KEYSTORE_URL" -A 5 > ../vault/vault.properties
sed -e "s/root/$USERNAME/g" -i ../conf/server.xml
'WAS' 카테고리의 다른 글
GossipRouter 설정 방법 (3) | 2019.07.23 |
---|---|
Session clustering (udp/tcp), sticky session (0) | 2018.11.01 |
IIS && EAP 연동 (0) | 2018.05.30 |
[Apache] Permission denied: make_sock: could not bind to address [::]:80 (0) | 2018.04.30 |
[limits.conf] 유저 리소스 파라미터 설정 (0) | 2018.04.24 |