Last active
January 11, 2023 19:21
-
-
Save ebruchez/27057552f5b56fc334fc to your computer and use it in GitHub Desktop.
Example of basic Tomcat server.xml with SQL Server datasource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Server port="8005" shutdown="SHUTDOWN"> | |
| <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/> | |
| <Listener className="org.apache.catalina.core.JasperListener"/> | |
| <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/> | |
| <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/> | |
| <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/> | |
| <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="8080" protocol="HTTP/1.1" | |
| connectionTimeout="20000" | |
| compression="force" | |
| compressableMimeType=" | |
| text/html,text/xml,text/plain,text/css, | |
| text/javascript,text/json,application/x-javascript, | |
| application/javascript,application/json" | |
| redirectPort="8443" | |
| URIEncoding="utf-8"/> | |
| <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> | |
| <Engine name="Catalina" defaultHost="localhost"> | |
| <Realm className="org.apache.catalina.realm.LockOutRealm"> | |
| <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> | |
| </Realm> | |
| <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> | |
| <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" | |
| prefix="localhost_access_log." suffix=".txt" | |
| pattern="%h %l %u %t "%r" %s %b"/> | |
| <Context path="/orbeon" docBase="/path/to/orbeon-war" reloadable="false" | |
| override="true" crossContext="true" allowLinking="true"> | |
| <Resource name="jdbc/sqlserver" auth="Container" type="javax.sql.DataSource" | |
| initialSize="3" maxActive="10" maxIdle="20" maxWait="30000" | |
| validationQuery="select 1" | |
| driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" | |
| poolPreparedStatements="true" | |
| username="orbeon" | |
| password="xxxxxxxx" | |
| url="jdbc:sqlserver://example.com:1433;databaseName=orbeon"/> | |
| </Context> | |
| </Host> | |
| </Engine> | |
| </Service> | |
| </Server> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you