## Monday, September 26, 2011

### Simple Batch Script to Run Tomcat

Sometimes it's a good idea to separate the actual Tomcat installation from the running configuration. Actually Tomcat comes with this ability built-in:
`catalina.base`
system property defines the location of the configuration, while
`catalina.home`
system property defines the location of the Tomcat installation.
And here comes the basic script that runs the Tomcat:

```@echo off
setlocal

SET TOMCAT_BASE=c:\work\tomcats\tomcat1
SET TOMCAT_HOME=C:\tps\apache-tomcat-7.0.16
SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\bin\tomcat-juli.jar;%JAVA_HOME%\lib\tools.jar
SET JAVA_ENDORSED_DIRS=%TOMCAT_HOME%\endorsed
SET JAVA_OPTS=