This repository has been archived by the owner on Dec 3, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Runtime Configuration Examples
Ralph Schaer edited this page Feb 6, 2013
·
6 revisions
- Use extraction directory app.
- Disable most of Tomcat's startup log messages.
- Set system property customer with value 'custA'.
- Start a blocking java based or APR/native connector (depends if Tomcat native library is installed) on port 80.
- Deploy the first available war in the root context.
- Install database pool with JNDI name 'jdbc/app'. Encrypt username and password.
- Set environment entry with name 'email' and value 'test@test.com'.
- Installs shutdown hook
extractDirectory: app
silent: true
useShutdownHook: true
connector:
port: 80
systemProperties:
customer: custA
context:
resource:
name: jdbc/app
factory: org.apache.tomcat.jdbc.pool.DataSourceFactory
auth: Container
type: javax.sql.DataSource
username: ENCxXOVLI1ckZM=ndRKXnaBYD4=
password: ENCjuqjztvF6Oo=CQrDnW/POX8F/rRELBpH3g==
driverClassName: net.sourceforge.jtds.jdbc.Driver
url: jdbc:jtds:sqlserver://192.168.20.165/app
maxActive: 20
maxIdle: 20
maxWait: 10000
defaultAutoCommit: false
environment:
name: email
value: test@test.com
type: java.lang.String
- Use extraction directory tc.
- Start a non-blocking java connector on port 80 and a non blocking ajp connector on port 81.
- Deploy the first available war in the /app context.
- Install access log valve.
- Set shutdown port and command
shutdown:
port: 8002
command: MY_SHUTDOWN_COMMAND
connectors:
- port: 80
protocol: org.apache.coyote.http11.Http11NioProtocol
- port: 81
protocol: org.apache.coyote.ajp.AjpNioProtocol
context:
contextPath: /app
valve:
className: org.apache.catalina.valves.AccessLogValve
directory: logs
prefix: localhost_access_log
suffix: .txt
pattern: "%h %l %u %t %r %s %b"
- Use extraction directory tc.
- Start a blocking java based or APR/native connector (depends if Tomcat native library is installed) on port 8080.
- Deploy the war that matches the name 'first*.war' to the context path /one and set the context parameter 'companyName'.
- Deploy the war that matches the name 'second*.war' to the context path /two and set the context file.
- Deploy an external war (not included in our jar) to the context path /three and enable session persistence.
contexts:
- embeddedWar: first*.war
contextPath: /one
parameter:
name: companyName
value: My Company, Incorporated
override: false
- embeddedWar: second*.war
contextPath: /two
contextFile: /var/myconfig.xml
- externalWar: /opt/anotherapp.war
contextPath: /three
sessionPersistence: true
- Use extraction directory tc.
- Install the default Tomcat lifecycle listerners.
- Set jvmRoute to 'server1'.
- Deploy the first available war to the ROOT context.
listeners:
- org.apache.catalina.core.AprLifecycleListener
- org.apache.catalina.core.JasperListener
- org.apache.catalina.core.JreMemoryLeakPreventionListener
- org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
- org.apache.catalina.core.ThreadLocalLeakPreventionListener
jvmRoute: server1