Advertisement
Guest User

Untitled

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