server.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <!-- Example Server Configuration File -->
  2. <!-- Note that component elements are nested corresponding to their
  3. parent-child relationships with each other -->
  4. <!-- A "Server" is a singleton element that represents the entire JVM,
  5. which may contain one or more "Service" instances. The Server
  6. listens for a shutdown command on the indicated port.
  7. Note: A "Server" is not itself a "Container", so you may not
  8. define subcomponents such as "Valves" or "Loggers" at this level.
  9. -->
  10. <Server port="8005" shutdown="SHUTDOWN" debug="0">
  11. <!-- Comment these entries out to disable JMX MBeans support -->
  12. <!-- You may also configure custom components (e.g. Valves/Realms) by
  13. including your own mbean-descriptor file(s), and setting the
  14. "descriptors" attribute to point to a ';' seperated list of paths
  15. (in the ClassLoader sense) of files to add to the default list.
  16. e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
  17. -->
  18. <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
  19. debug="0"/>
  20. <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
  21. debug="0"/>
  22. <!-- Global JNDI resources -->
  23. <GlobalNamingResources>
  24. <!-- Test entry for demonstration purposes -->
  25. <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
  26. <!-- Editable user database that can also be used by
  27. UserDatabaseRealm to authenticate users -->
  28. <Resource name="UserDatabase" auth="Container"
  29. type="org.apache.catalina.UserDatabase"
  30. description="User database that can be updated and saved">
  31. </Resource>
  32. <ResourceParams name="UserDatabase">
  33. <parameter>
  34. <name>factory</name>
  35. <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
  36. </parameter>
  37. <parameter>
  38. <name>pathname</name>
  39. <value>conf/tomcat-users.xml</value>
  40. </parameter>
  41. </ResourceParams>
  42. </GlobalNamingResources>
  43. <!-- A "Service" is a collection of one or more "Connectors" that share
  44. a single "Container" (and therefore the web applications visible
  45. within that Container). Normally, that Container is an "Engine",
  46. but this is not required.
  47. Note: A "Service" is not itself a "Container", so you may not
  48. define subcomponents such as "Valves" or "Loggers" at this level.
  49. -->
  50. <!-- Define the Tomcat Stand-Alone Service -->
  51. <Service name="Tomcat-Standalone">
  52. <!-- A "Connector" represents an endpoint by which requests are received
  53. and responses are returned. Each Connector passes requests on to the
  54. associated "Container" (normally an Engine) for processing.
  55. By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
  56. You can also enable an SSL HTTP/1.1 Connector on port 8443 by
  57. following the instructions below and uncommenting the second Connector
  58. entry. SSL support requires the following steps (see the SSL Config
  59. HOWTO in the Tomcat 4.0 documentation bundle for more detailed
  60. instructions):
  61. * Download and install JSSE 1.0.2 or later, and put the JAR files
  62. into "$JAVA_HOME/jre/lib/ext".
  63. * Execute:
  64. %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
  65. $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
  66. with a password value of "changeit" for both the certificate and
  67. the keystore itself.
  68. By default, DNS lookups are enabled when a web application calls
  69. request.getRemoteHost(). This can have an adverse impact on
  70. performance, so you can disable it by setting the
  71. "enableLookups" attribute to "false". When DNS lookups are disabled,
  72. request.getRemoteHost() will return the String version of the
  73. IP address of the remote client.
  74. -->
  75. <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
  76. <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
  77. port="8080" minProcessors="5" maxProcessors="75"
  78. enableLookups="true" redirectPort="8443"
  79. acceptCount="100" debug="0" connectionTimeout="20000"
  80. useURIValidationHack="false" disableUploadTimeout="true" />
  81. <!-- Note : To disable connection timeouts, set connectionTimeout value
  82. to 0 -->
  83. <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
  84. <!--
  85. <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
  86. port="8443" minProcessors="5" maxProcessors="75"
  87. enableLookups="true"
  88. acceptCount="100" debug="0" scheme="https" secure="true"
  89. useURIValidationHack="false" disableUploadTimeout="true">
  90. <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
  91. clientAuth="false" protocol="TLS" />
  92. </Connector>
  93. -->
  94. <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
  95. <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
  96. port="8009" minProcessors="5" maxProcessors="75"
  97. enableLookups="true" redirectPort="8443"
  98. acceptCount="10" debug="0" connectionTimeout="0"
  99. useURIValidationHack="false"
  100. protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
  101. <!-- Define an AJP 1.3 Connector on port 8009 -->
  102. <!--
  103. <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
  104. port="8009" minProcessors="5" maxProcessors="75"
  105. acceptCount="10" debug="0"/>
  106. -->
  107. <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
  108. <!-- See proxy documentation for more information about using this. -->
  109. <!--
  110. <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
  111. port="8082" minProcessors="5" maxProcessors="75"
  112. enableLookups="true"
  113. acceptCount="100" debug="0" connectionTimeout="20000"
  114. proxyPort="80" useURIValidationHack="false"
  115. disableUploadTimeout="true" />
  116. -->
  117. <!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
  118. <!--
  119. <Connector className="org.apache.catalina.connector.http.HttpConnector"
  120. port="8083" minProcessors="5" maxProcessors="75"
  121. enableLookups="true" redirectPort="8443"
  122. acceptCount="10" debug="0" />
  123. -->
  124. <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
  125. <!--
  126. <Connector className="org.apache.catalina.connector.http10.HttpConnector"
  127. port="8084" minProcessors="5" maxProcessors="75"
  128. enableLookups="true" redirectPort="8443"
  129. acceptCount="10" debug="0" />
  130. -->
  131. <!-- An Engine represents the entry point (within Catalina) that processes
  132. every request. The Engine implementation for Tomcat stand alone
  133. analyzes the HTTP headers included with the request, and passes them
  134. on to the appropriate Host (virtual host). -->
  135. <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
  136. <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
  137. -->
  138. <!-- Define the top level container in our container hierarchy -->
  139. <Engine name="Standalone" defaultHost="localhost" debug="0">
  140. <!-- The request dumper valve dumps useful debugging information about
  141. the request headers and cookies that were received, and the response
  142. headers and cookies that were sent, for all requests received by
  143. this instance of Tomcat. If you care only about requests to a
  144. particular virtual host, or a particular application, nest this
  145. element inside the corresponding <Host> or <Context> entry instead.
  146. For a similar mechanism that is portable to all Servlet 2.3
  147. containers, check out the "RequestDumperFilter" Filter in the
  148. example application (the source for this filter may be found in
  149. "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
  150. Request dumping is disabled by default. Uncomment the following
  151. element to enable it. -->
  152. <!--
  153. <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
  154. -->
  155. <!-- Global logger unless overridden at lower levels -->
  156. <Logger className="org.apache.catalina.logger.FileLogger"
  157. prefix="catalina_log." suffix=".txt"
  158. timestamp="true"/>
  159. <!-- Because this Realm is here, an instance will be shared globally -->
  160. <Realm className="net.sf.acegisecurity.adapters.catalina.CatalinaAcegiUserRealm"
  161. appContextLocation="conf/acegisecurity.xml"
  162. key="my_password"/>
  163. <!-- Comment out the old realm but leave here for now in case we
  164. need to go back quickly -->
  165. <!--
  166. <Realm className="org.apache.catalina.realm.MemoryRealm" />
  167. -->
  168. <!-- Replace the above Realm with one of the following to get a Realm
  169. stored in a database and accessed via JDBC -->
  170. <!--
  171. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  172. driverName="org.gjt.mm.mysql.Driver"
  173. connectionURL="jdbc:mysql://localhost/authority"
  174. connectionName="test" connectionPassword="test"
  175. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  176. userRoleTable="user_roles" roleNameCol="role_name" />
  177. -->
  178. <!--
  179. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  180. driverName="oracle.jdbc.driver.OracleDriver"
  181. connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
  182. connectionName="scott" connectionPassword="tiger"
  183. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  184. userRoleTable="user_roles" roleNameCol="role_name" />
  185. -->
  186. <!--
  187. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  188. driverName="sun.jdbc.odbc.JdbcOdbcDriver"
  189. connectionURL="jdbc:odbc:CATALINA"
  190. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  191. userRoleTable="user_roles" roleNameCol="role_name" />
  192. -->
  193. <!-- Define the default virtual host -->
  194. <Host name="localhost" debug="0" appBase="webapps"
  195. unpackWARs="true" autoDeploy="true">
  196. <!-- Normally, users must authenticate themselves to each web app
  197. individually. Uncomment the following entry if you would like
  198. a user to be authenticated the first time they encounter a
  199. resource protected by a security constraint, and then have that
  200. user identity maintained across *all* web applications contained
  201. in this virtual host. -->
  202. <!--
  203. <Valve className="org.apache.catalina.authenticator.SingleSignOn"
  204. debug="0"/>
  205. -->
  206. <!-- Access log processes all requests for this virtual host. By
  207. default, log files are created in the "logs" directory relative to
  208. $CATALINA_HOME. If you wish, you can specify a different
  209. directory with the "directory" attribute. Specify either a relative
  210. (to $CATALINA_HOME) or absolute path to the desired directory.
  211. -->
  212. <!--
  213. <Valve className="org.apache.catalina.valves.AccessLogValve"
  214. directory="logs" prefix="localhost_access_log." suffix=".txt"
  215. pattern="common" resolveHosts="false"/>
  216. -->
  217. <!-- Logger shared by all Contexts related to this virtual host. By
  218. default (when using FileLogger), log files are created in the "logs"
  219. directory relative to $CATALINA_HOME. If you wish, you can specify
  220. a different directory with the "directory" attribute. Specify either a
  221. relative (to $CATALINA_HOME) or absolute path to the desired
  222. directory.-->
  223. <Logger className="org.apache.catalina.logger.FileLogger"
  224. directory="logs" prefix="localhost_log." suffix=".txt"
  225. timestamp="true"/>
  226. <!-- Define properties for each web application. This is only needed
  227. if you want to set non-default properties, or have web application
  228. document roots in places other than the virtual host's appBase
  229. directory. -->
  230. <!-- Tomcat Root Context -->
  231. <!--
  232. <Context path="" docBase="ROOT" debug="0"/>
  233. -->
  234. <!-- Tomcat Examples Context -->
  235. <Context path="/examples" docBase="examples" debug="0"
  236. reloadable="true" crossContext="true">
  237. <Logger className="org.apache.catalina.logger.FileLogger"
  238. prefix="localhost_examples_log." suffix=".txt"
  239. timestamp="true"/>
  240. <Ejb name="ejb/EmplRecord" type="Entity"
  241. home="com.wombat.empl.EmployeeRecordHome"
  242. remote="com.wombat.empl.EmployeeRecord"/>
  243. <!-- If you wanted the examples app to be able to edit the
  244. user database, you would uncomment the following entry.
  245. Of course, you would want to enable security on the
  246. application as well, so this is not done by default!
  247. The database object could be accessed like this:
  248. Context initCtx = new InitialContext();
  249. Context envCtx = (Context) initCtx.lookup("java:comp/env");
  250. UserDatabase database =
  251. (UserDatabase) envCtx.lookup("userDatabase");
  252. -->
  253. <!--
  254. <ResourceLink name="userDatabase" global="UserDatabase"
  255. type="org.apache.catalina.UserDatabase"/>
  256. -->
  257. <!-- PersistentManager: Uncomment the section below to test Persistent
  258. Sessions.
  259. saveOnRestart: If true, all active sessions will be saved
  260. to the Store when Catalina is shutdown, regardless of
  261. other settings. All Sessions found in the Store will be
  262. loaded on startup. Sessions past their expiration are
  263. ignored in both cases.
  264. maxActiveSessions: If 0 or greater, having too many active
  265. sessions will result in some being swapped out. minIdleSwap
  266. limits this. -1 or 0 means unlimited sessions are allowed.
  267. If it is not possible to swap sessions new sessions will
  268. be rejected.
  269. This avoids thrashing when the site is highly active.
  270. minIdleSwap: Sessions must be idle for at least this long
  271. (in seconds) before they will be swapped out due to
  272. activity.
  273. 0 means sessions will almost always be swapped out after
  274. use - this will be noticeably slow for your users.
  275. maxIdleSwap: Sessions will be swapped out if idle for this
  276. long (in seconds). If minIdleSwap is higher, then it will
  277. override this. This isn't exact: it is checked periodically.
  278. -1 means sessions won't be swapped out for this reason,
  279. although they may be swapped out for maxActiveSessions.
  280. If set to >= 0, guarantees that all sessions found in the
  281. Store will be loaded on startup.
  282. maxIdleBackup: Sessions will be backed up (saved to the Store,
  283. but left in active memory) if idle for this long (in seconds),
  284. and all sessions found in the Store will be loaded on startup.
  285. If set to -1 sessions will not be backed up, 0 means they
  286. should be backed up shortly after being used.
  287. To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
  288. and minIdleBackup all to -1, saveOnRestart to false, then restart
  289. Catalina.
  290. -->
  291. <!--
  292. <Manager className="org.apache.catalina.session.PersistentManager"
  293. debug="0"
  294. saveOnRestart="true"
  295. maxActiveSessions="-1"
  296. minIdleSwap="-1"
  297. maxIdleSwap="-1"
  298. maxIdleBackup="-1">
  299. <Store className="org.apache.catalina.session.FileStore"/>
  300. </Manager>
  301. -->
  302. <Environment name="maxExemptions" type="java.lang.Integer"
  303. value="15"/>
  304. <Parameter name="context.param.name" value="context.param.value"
  305. override="false"/>
  306. <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
  307. type="javax.sql.DataSource"/>
  308. <ResourceParams name="jdbc/EmployeeAppDb">
  309. <parameter><name>username</name><value>sa</value></parameter>
  310. <parameter><name>password</name><value></value></parameter>
  311. <parameter><name>driverClassName</name>
  312. <value>org.hsql.jdbcDriver</value></parameter>
  313. <parameter><name>url</name>
  314. <value>jdbc:HypersonicSQL:database</value></parameter>
  315. </ResourceParams>
  316. <Resource name="mail/Session" auth="Container"
  317. type="javax.mail.Session"/>
  318. <ResourceParams name="mail/Session">
  319. <parameter>
  320. <name>mail.smtp.host</name>
  321. <value>localhost</value>
  322. </parameter>
  323. </ResourceParams>
  324. <ResourceLink name="linkToGlobalResource"
  325. global="simpleValue"
  326. type="java.lang.Integer"/>
  327. </Context>
  328. </Host>
  329. </Engine>
  330. </Service>
  331. </Server>