Skip to content

Instantly share code, notes, and snippets.

@ninformations
Created January 20, 2015 12:21
Show Gist options
  • Save ninformations/a78bb8f3eb6c1fe4c01e to your computer and use it in GitHub Desktop.
Save ninformations/a78bb8f3eb6c1fe4c01e to your computer and use it in GitHub Desktop.
multiple tomcat instance
#!/bin/sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
# Get standard environment variables
PRGDIR=`dirname "$PRG"`
export CATALINA_BASE=`cd "$PRGDIR/.." >/dev/null; pwd`
echo "setting CATALINA_BASE as: $CATALINA_BASE"
# remove dev logs from catalina
rm -rf "$CATALINA_BASE/logs/*"
# assumes tomcat is just outside the path
sh "$CATALINA_BASE/../tomcat/bin/catalina.sh" "$@"
@ninformations
Copy link
Author

copy all directories excluding bin, lib into new CATALINA_BASE.
change server.xml for different port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment