Server.xml


Minimalistic server.xml to show how to configure the JK connector

<?xml version='1.0' encoding='utf-8'?>
<Server port="@tomcat.serverport@" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <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">
    <Connector port="@tomcat.directport@" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
    <Connector port="@tomcat.ajpport@" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

        <Context path="/openolat" docBase="/opt/openolat/src/main/webapp" reloadable="false">
	  <!-- 
	    Use container data source for database connection pooling instead of bundled connection pool for more stability 
	    in olat.local.properties set following properties:
	    db.source=jndi
	    db.jndi=java:comp/env/jdbc/OpenOLATDS
	  --> 
	  <Resource name="jdbc/OpenOLATDS" auth="Container" type="javax.sql.DataSource"
	     maxActive="100" maxIdle="30" maxWait="60000"  driverClassName="com.mysql.jdbc.Driver"
	     username="openolat" password="openolat"
	     url="jdbc:mysql://localhost:3306/openolat?useUnicode=true&characterEncoding=UTF-8&cachePrepStmts=true&cacheCallableStmts=true&autoReconnectForPools=true"
	  />
         </Context>
      </Host>
    </Engine>
  </Service>
</Server>