Statistics
| Revision:

root / tmp / trunk / servidor / WorkSpace_Servidor / Servers / Tomcat v5.5 Server @ localhost-config / server.xml @ 26464

History | View | Annotate | Download (18.6 KB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- Example Server Configuration File --><!-- Note that component elements are nested corresponding to their
3
     parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
4
     which may contain one or more "Service" instances.  The Server
5
     listens for a shutdown command on the indicated port.
6

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
 --><Server port="9005" shutdown="SHUTDOWN">
10

    
11
  <!-- Comment these entries out to disable JMX MBeans support used for the 
12
       administration web application -->
13
  <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
14
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
15
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
16
  <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
17

    
18
  <!-- Global JNDI resources -->
19
  <GlobalNamingResources>
20

    
21
    <!-- Test entry for demonstration purposes -->
22
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
23

    
24
    <!-- Editable user database that can also be used by
25
         UserDatabaseRealm to authenticate users -->
26
    <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
27

    
28
  </GlobalNamingResources>
29

    
30
  <!-- A "Service" is a collection of one or more "Connectors" that share
31
       a single "Container" (and therefore the web applications visible
32
       within that Container).  Normally, that Container is an "Engine",
33
       but this is not required.
34

35
       Note:  A "Service" is not itself a "Container", so you may not
36
       define subcomponents such as "Valves" or "Loggers" at this level.
37
   -->
38

    
39
  <!-- Define the Tomcat Stand-Alone Service -->
40
  <Service name="Catalina">
41

    
42
    <!-- A "Connector" represents an endpoint by which requests are received
43
         and responses are returned.  Each Connector passes requests on to the
44
         associated "Container" (normally an Engine) for processing.
45

46
         By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
47
         You can also enable an SSL HTTP/1.1 Connector on port 8443 by
48
         following the instructions below and uncommenting the second Connector
49
         entry.  SSL support requires the following steps (see the SSL Config
50
         HOWTO in the Tomcat 5 documentation bundle for more detailed
51
         instructions):
52
         * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
53
           later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
54
         * Execute:
55
             %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
56
             $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
57
           with a password value of "changeit" for both the certificate and
58
           the keystore itself.
59

60
         By default, DNS lookups are enabled when a web application calls
61
         request.getRemoteHost().  This can have an adverse impact on
62
         performance, so you can disable it by setting the
63
         "enableLookups" attribute to "false".  When DNS lookups are disabled,
64
         request.getRemoteHost() will return the String version of the
65
         IP address of the remote client.
66
    -->
67

    
68
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
69
    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="9080" redirectPort="9443"/>
70
    <!-- Note : To disable connection timeouts, set connectionTimeout value
71
     to 0 -->
72
        
73
        <!-- Note : To use gzip compression you could set the following properties :
74
        
75
                           compression="on" 
76
                           compressionMinSize="2048" 
77
                           noCompressionUserAgents="gozilla, traviata" 
78
                           compressableMimeType="text/html,text/xml"
79
        -->
80

    
81
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
82
    <!--
83
    <Connector port="8443" maxHttpHeaderSize="8192"
84
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
85
               enableLookups="false" disableUploadTimeout="true"
86
               acceptCount="100" scheme="https" secure="true"
87
               clientAuth="false" sslProtocol="TLS" />
88
    -->
89

    
90
    <!-- Define an AJP 1.3 Connector on port 9009 -->
91
    <Connector enableLookups="false" port="9009" protocol="AJP/1.3" redirectPort="8443"/>
92

    
93
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
94
    <!-- See proxy documentation for more information about using this. -->
95
    <!--
96
    <Connector port="8082" 
97
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
98
               enableLookups="false" acceptCount="100" connectionTimeout="20000"
99
               proxyPort="80" disableUploadTimeout="true" />
100
    -->
101

    
102
    <!-- An Engine represents the entry point (within Catalina) that processes
103
         every request.  The Engine implementation for Tomcat stand alone
104
         analyzes the HTTP headers included with the request, and passes them
105
         on to the appropriate Host (virtual host). -->
106

    
107
    <!-- You should set jvmRoute to support load-balancing via AJP ie :
108
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
109
    --> 
110
         
111
    <!-- Define the top level container in our container hierarchy -->
112
    <Engine defaultHost="localhost" name="Catalina">
113

    
114
      <!-- The request dumper valve dumps useful debugging information about
115
           the request headers and cookies that were received, and the response
116
           headers and cookies that were sent, for all requests received by
117
           this instance of Tomcat.  If you care only about requests to a
118
           particular virtual host, or a particular application, nest this
119
           element inside the corresponding <Host> or <Context> entry instead.
120

121
           For a similar mechanism that is portable to all Servlet 2.4
122
           containers, check out the "RequestDumperFilter" Filter in the
123
           example application (the source for this filter may be found in
124
           "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
125

126
           Note that this Valve uses the platform's default character encoding.
127
           This may cause problems for developers in another encoding, e.g.
128
           UTF-8.  Use the RequestDumperFilter instead.
129

130
           Also note that enabling this Valve will write a ton of stuff to your
131
           logs.  They are likely to grow quite large.  This extensive log writing
132
           will definitely slow down your server.
133

134
           Request dumping is disabled by default.  Uncomment the following
135
           element to enable it. -->
136
      <!--
137
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
138
      -->
139

    
140
      <!-- Because this Realm is here, an instance will be shared globally -->
141

    
142
      <!-- This Realm uses the UserDatabase configured in the global JNDI
143
           resources under the key "UserDatabase".  Any edits
144
           that are performed against this UserDatabase are immediately
145
           available for use by the Realm.  -->
146
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
147

    
148
      <!-- Comment out the old realm but leave here for now in case we
149
           need to go back quickly -->
150
      <!--
151
      <Realm className="org.apache.catalina.realm.MemoryRealm" />
152
      -->
153

    
154
      <!-- Replace the above Realm with one of the following to get a Realm
155
           stored in a database and accessed via JDBC -->
156

    
157
      <!--
158
      <Realm  className="org.apache.catalina.realm.JDBCRealm"
159
             driverName="org.gjt.mm.mysql.Driver"
160
          connectionURL="jdbc:mysql://localhost/authority"
161
         connectionName="test" connectionPassword="test"
162
              userTable="users" userNameCol="user_name" userCredCol="user_pass"
163
          userRoleTable="user_roles" roleNameCol="role_name" />
164
      -->
165

    
166
      <!--
167
      <Realm  className="org.apache.catalina.realm.JDBCRealm"
168
             driverName="oracle.jdbc.driver.OracleDriver"
169
          connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
170
         connectionName="scott" connectionPassword="tiger"
171
              userTable="users" userNameCol="user_name" userCredCol="user_pass"
172
          userRoleTable="user_roles" roleNameCol="role_name" />
173
      -->
174

    
175
      <!--
176
      <Realm  className="org.apache.catalina.realm.JDBCRealm"
177
             driverName="sun.jdbc.odbc.JdbcOdbcDriver"
178
          connectionURL="jdbc:odbc:CATALINA"
179
              userTable="users" userNameCol="user_name" userCredCol="user_pass"
180
          userRoleTable="user_roles" roleNameCol="role_name" />
181
      -->
182

    
183
      <!-- Define the default virtual host
184
           Note: XML Schema validation will not work with Xerces 2.2.
185
       -->
186
      <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
187

    
188
        <!-- Defines a cluster for this node,
189
             By defining this element, means that every manager will be changed.
190
             So when running a cluster, only make sure that you have webapps in there
191
             that need to be clustered and remove the other ones.
192
             A cluster has the following parameters:
193

194
             className = the fully qualified name of the cluster class
195

196
             clusterName = a descriptive name for your cluster, can be anything
197

198
             mcastAddr = the multicast address, has to be the same for all the nodes
199

200
             mcastPort = the multicast port, has to be the same for all the nodes
201
             
202
             mcastBindAddress = bind the multicast socket to a specific address
203
             
204
             mcastTTL = the multicast TTL if you want to limit your broadcast
205
             
206
             mcastSoTimeout = the multicast readtimeout 
207

208
             mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
209

210
             mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
211

212
             tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes 
213

214
             tcpListenAddress = the listen address (bind address) for TCP cluster request on this host, 
215
                                in case of multiple ethernet cards.
216
                                auto means that address becomes
217
                                InetAddress.getLocalHost().getHostAddress()
218

219
             tcpListenPort = the tcp listen port
220

221
             tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
222
                                  has a wakup bug in java.nio. Set to 0 for no timeout
223

224
             printToScreen = true means that managers will also print to std.out
225

226
             expireSessionsOnShutdown = true means that 
227

228
             useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
229
                            false means to replicate the session after each request.
230
                            false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
231
                            <%
232
                            HashMap map = (HashMap)session.getAttribute("map");
233
                            map.put("key","value");
234
                            %>
235
             replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
236
                               * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
237
                               * Synchronous means that the thread that executes the request, is also the
238
                               thread the replicates the data to the other nodes, and will not return until all
239
                               nodes have received the information.
240
                               * Asynchronous means that there is a specific 'sender' thread for each cluster node,
241
                               so the request thread will queue the replication request into a "smart" queue,
242
                               and then return to the client.
243
                               The "smart" queue is a queue where when a session is added to the queue, and the same session
244
                               already exists in the queue from a previous request, that session will be replaced
245
                               in the queue instead of replicating two requests. This almost never happens, unless there is a 
246
                               large network delay.
247
        -->             
248
        <!--
249
            When configuring for clustering, you also add in a valve to catch all the requests
250
            coming in, at the end of the request, the session may or may not be replicated.
251
            A session is replicated if and only if all the conditions are met:
252
            1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
253
            2. a session exists (has been created)
254
            3. the request is not trapped by the "filter" attribute
255

256
            The filter attribute is to filter out requests that could not modify the session,
257
            hence we don't replicate the session after the end of this request.
258
            The filter is negative, ie, anything you put in the filter, you mean to filter out,
259
            ie, no replication will be done on requests that match one of the filters.
260
            The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
261

262
            filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
263
            ending with .gif and .js are intercepted.
264
            
265
            The deployer element can be used to deploy apps cluster wide.
266
            Currently the deployment only deploys/undeploys to working members in the cluster
267
            so no WARs are copied upons startup of a broken node.
268
            The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
269
            When a new war file is added the war gets deployed to the local instance,
270
            and then deployed to the other instances in the cluster.
271
            When a war file is deleted from the watchDir the war is undeployed locally 
272
            and cluster wide
273
        -->
274
        
275
        <!--
276
        <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
277
                 managerClassName="org.apache.catalina.cluster.session.DeltaManager"
278
                 expireSessionsOnShutdown="false"
279
                 useDirtyFlag="true"
280
                 notifyListenersOnReplication="true">
281

282
            <Membership 
283
                className="org.apache.catalina.cluster.mcast.McastService"
284
                mcastAddr="228.0.0.4"
285
                mcastPort="45564"
286
                mcastFrequency="500"
287
                mcastDropTime="3000"/>
288

289
            <Receiver 
290
                className="org.apache.catalina.cluster.tcp.ReplicationListener"
291
                tcpListenAddress="auto"
292
                tcpListenPort="4001"
293
                tcpSelectorTimeout="100"
294
                tcpThreadCount="6"/>
295

296
            <Sender
297
                className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
298
                replicationMode="pooled"
299
                ackTimeout="15000"
300
                waitForAck="true"/>
301

302
            <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
303
                   filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
304
                   
305
            <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
306
                      tempDir="/tmp/war-temp/"
307
                      deployDir="/tmp/war-deploy/"
308
                      watchDir="/tmp/war-listen/"
309
                      watchEnabled="false"/>
310
                      
311
            <ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
312
        </Cluster>
313
        -->        
314

    
315

    
316

    
317
        <!-- Normally, users must authenticate themselves to each web app
318
             individually.  Uncomment the following entry if you would like
319
             a user to be authenticated the first time they encounter a
320
             resource protected by a security constraint, and then have that
321
             user identity maintained across *all* web applications contained
322
             in this virtual host. -->
323
        <!--
324
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
325
        -->
326

    
327
        <!-- Access log processes all requests for this virtual host.  By
328
             default, log files are created in the "logs" directory relative to
329
             $CATALINA_HOME.  If you wish, you can specify a different
330
             directory with the "directory" attribute.  Specify either a relative
331
             (to $CATALINA_HOME) or absolute path to the desired directory.
332
        -->
333
        <!--
334
        <Valve className="org.apache.catalina.valves.AccessLogValve"
335
                 directory="logs"  prefix="localhost_access_log." suffix=".txt"
336
                 pattern="common" resolveHosts="false"/>
337
        -->
338

    
339
        <!-- Access log processes all requests for this virtual host.  By
340
             default, log files are created in the "logs" directory relative to
341
             $CATALINA_HOME.  If you wish, you can specify a different
342
             directory with the "directory" attribute.  Specify either a relative
343
             (to $CATALINA_HOME) or absolute path to the desired directory.
344
             This access log implementation is optimized for maximum performance,
345
             but is hardcoded to support only the "common" and "combined" patterns.
346
        -->
347
        <!--
348
        <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
349
                 directory="logs"  prefix="localhost_access_log." suffix=".txt"
350
                 pattern="common" resolveHosts="false"/>
351
        -->
352

    
353
<!--
354
       <Context docBase="wps_ws_spring" path="/wps_ws_spring" reloadable="true" source="org.eclipse.jst.j2ee.server:wps_ws_spring"/><Context docBase="WPS040SimpleWebGenericClient" path="/WPS040SimpleWebGenericClient" reloadable="true" source="org.eclipse.jst.j2ee.server:WPS040SimpleWebGenericClient"/>
355
-->
356

    
357
    </Host>
358

    
359
    </Engine>
360

    
361
  </Service>
362

    
363
</Server>