Logo
Published on

Apache Tomcat Multi instances on OS X

Authors

Apache Tomcat Multi instances on OS X

I recently post about doing such a thing on Windows, now let's look at the OS X setps:

Download and Install a Java SE Runtime Environment; Download and Install Apache Tomcat, see previous post about it

Configure Environment Variables

Set CATALINA_HOME, CATALINA_BASE, and JAVA_HOME or JRE_HOME

export CATALINA_HOME=/Library/Tomcat
export CATALINA_BASE=~/work/code/project/tomcat
export JAVA_HOME=$(/usr/libexec/java_home)

copy conf directory from CATALINA_HOME to CATALINA_BASE

cd $CATALINA_BASE
sudo cp -rp /Library/Tomcat/conf/ conf/
sudo chown -R <your_username> conf

create logs and temp directories

create a webapps directory and copy you war files.

Startup tomcat with

$CATALINA_HOME/bin/startup.sh

and shutdown Tomcat with

$CATALINA_HOME/bin/shutdown.sh

For full details look at "Advanced Configuration - Multiple Tomcat Instances" in RUNNING.txt file.