Simple tc Server Configuration

The following sample server.xml file shows a basic out-of-the-box configuration for tc Server included in tc Server. This configuration file uses typical values for a standard set of XML elements. Sample server.xml files in later sections of this documentation build on this file.

This server.xml file uses variable substitution for configuration properties that must be unique across multiple server instances computer, such as HTTP and JMX port numbers. These variables take the form ${var}. For example, the variable for the HTTP port that tc Server listens to is ${http.port}. The specific values for these variables for a particular server instance are stored in the catalina.properties file, located in the same directory as the server.xml file. A snippet of the default catalina.properties file is shown after the sample server.xml file; the snippet shows specific values of variables such as the HTTP port.

See Description of the Basic server.xml File for information about the elements and attributes in this sample configuration file in case you need to change some to suit your own environment.

<?xml version='1.0' encoding='utf-8'?>
<Server port="${shutdown.port}" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <Listener className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener"
            port="${jmx.port}"
            bind="127.0.0.1"
            useSSL="false"
            passwordFile="${catalina.base}/conf/jmxremote.password"
            accessFile="${catalina.base}/conf/jmxremote.access"
            authenticate="true"/>

  <Listener className="com.springsource.tcserver.serviceability.deploy.TcContainerDeployer" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>


  <Service name="Catalina">

    <Executor name="tomcatThreadPool" namePrefix="tomcat-http--" maxThreads="300" minSpareThreads="50"/>

    <Connector
               executor="tomcatThreadPool"
               port="${http.port}"
               protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               acceptCount="100"
               maxKeepAliveRequests="15"/>

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" deployOnStartup="true" deployXML="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>
</Server> 

The following snippet of catalina.properties shows how to set values for the variables used in the preceding server.xml file.

   tcserver.node=tcServer
   shutdown.port=-1
   http.port=8080
   jmx.port=6969
   ajp.port=8009

Description of the Basic server.xml File

In the preceding sample server.xml:

The preceding sample server.xml file contains typical elements and attribute values for a simple out-of-the-box tc Server configuration. There are, however, many more elements and attributes you can configure in this file. For complete documentation about the tc Server server.xml file and all the possible XML elements you can include, see Apache Tomcat Configuration Reference.