From the course: Learning Apache Tomcat

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

More config files

More config files - Tomcat Tutorial

From the course: Learning Apache Tomcat

Start my 1-month free trial

More config files

- [Instructor] One of the main avenues of configuration for Tomcat and servlets is via environment variables available to the Tomcat service. We'll do this by creating a file called /usr/lib/tomcat8/bin/setenv.sh. This is already referenced by the other Tomcat scripts. So environment variables will be available to Tomcat. For example, when setting up Jenkins you'll need to specify what you want the default Jenkins home variable to be. That needs to be passed into Catalina in Tomcat via the Catalina_OPTS environment variable. This -D format is because that's how you pass parameters into Java. These are the command line options that are used by Java when running Catalina itself. That can be pretty confusing. Thankfully there are other options for this. One good one is editing the global context.xml file at /etc/tomcat8/context.xml. The syntax is pretty straightforward. You set a name for the variable and a value. One difference is that you'll need to set the data type. In this example…

Contents