Escolar Documentos
Profissional Documentos
Cultura Documentos
TE
RI
Humble Beginnings: The Apache Project The Apache Software Foundation The Jakarta Project
AL
1
2 3 3
4 4
PY
RI
GH
Java APIs The J2EE APIs J2EE Application Servers Agree on Standards, Compete on Implementation Tomcat and Application Servers
TE
MA
5 6
6 7 7
7
7 8 9 10 10
11 12
13
14 14
15 16
And on to JSPs . . . JSP Tag Libraries Web Application Architecture Java Site Architecture Summary
CO
18 21 24 25 27
Contents
Chapter 3: Tomcat Installation
Installing the Java Virtual Machine
Installing the Sun JVM on Windows
29
29
29
Installing Tomcat
Tomcat Windows Installer Finishing the Installation Setting Environment Variables Testing the Installation Installing Tomcat on Windows Using the ZIP File Installing Tomcat on Linux
33
33 34 34 34 39 40
41
41 42 42 42 42 42 42 43
43
43 44 44
Summary
44
45
45
47 47 50
Summary
50
51
52 53
54
58 60
60 66
Contents
Web Application Context Definitions Authentication and the tomcat-users.xml File The Default Deployment Descriptor web.xml How server.xml, Context Descriptors, and web.xml Work Together Fine-Grained Access Control: catalina.policy catalina.properties: Finer-Grained Control over Access Checks Configurator Bootstrapping and the Future of Tomcat Configuration A Final Word on Differentiating Between Configuration and Management 76 77 77 81 84 87 87 88
Summary
88
91
91
92 94 95
96
97 110
Summary
125
127
128 129
130 132
134
135 136 136 137 139 139 142 143 144 144 145 146 146 147
xi
Contents
Displaying Session Statistics Querying Tomcat Internals Using the JMX Proxy Servlet Setting Tomcat Internals Using the JMX Proxy Servlet 148 149 150
150
151 151 153
Tomcat Manager: Managing Applications with Ant Possible Errors Security Considerations Tomcat Deployer Summary
161
162 162 163
163 165
166
166 169
170
170 170 171 172
Persistent Sessions
The Need for Persistent Sessions Configuring a Persistent Session Manager
172
172 173
176
176 177 178 179 182 184
xii
Contents
Configuring Lifecycle Listeners
Lifecycle Events Sent by Tomcat Components The <Listener> Element Tomcat 5 Lifecycle Listeners Configuration
187
187 187 188
Summary
191
193
194
194 199 199
200
201 201 201 202
202
203 203 204 204 205
206 206
207 207 208
Summary
209
211
212
212 212 216
Configuring Tomcat for CGI Support Configuring Tomcat for SSI Support Running Tomcat Behind a Proxy Server Performance Tuning Summary
xiii
Contents
Chapter 11: Web Server Connectors
Reasons for Using a Web Server Connector Architecture
Communication Paths Connector Protocols
229
229 230
230 231
Choosing a Connector
JServ JK webapp JK2
233
233 234 234 234
Summary
235
237
238
238 238 239
239
239 240 240
241
241 243 243 247 247 248
Configuring SSL
Configuring SSL in Tomcat Configuring SSL in Apache Testing the SSL-Enabled Apache-Tomcat Setup
250
250 251 254
255
256 256 257 257 257 258 258
xiv
Contents
Tomcat Worker Configuration in workers2.properties Sample workers2.properties File 259 263
265
266 267 269
Summary
270
271
272 272
273 274 274 275 277 280 280 283 285
287 289
289 290 291 291
291 292
293
294
295 295 296 297 298
299 300
301 304 310
xv
Contents
Alternative JDBC Configuration Alternative Connection Pool Managers
About PoolMan Deploying PoolMan PoolMans XML Configuration File Obtaining JDBC Connections Without JNDI Lookup Testing PoolMan with a Legacy Hard-coded Driver Obtaining a Connection with JNDI Mapping Testing PoolMan with JNDI-Compatible Lookup Deploying Third-Party Pools
311 312
312 313 313 315 316 317 319 319
Summary
320
321
321
322 322 323 323 323
324
324 324
326
326 328
328
328 332 335
337 337
337 340 341
362
363 366
368 368
xvi
Contents
Chapter 16: Shared Tomcat Hosting
Virtual Hosting
IP-Based Virtual Hosting Name-Based Virtual Hosting
369
370
370 372
375
375
377
377 378 381
386
387 391
Summary
393
395
395 396
396 397 401 413
414
414 416 416
Optimization Techniques
Java Optimizations Tomcat Optimizations
416
417 418
419 419
421
421 423
424 426
xvii
Contents
Agent Level Distributed Services Level 427 430
430 430
431 431 431 431
431
432 436 437 439
444
445 447 450 452 452
454 454
457
458
458 459
Clustering Basics
Master-Backup Topological Pattern Fail-Over Behavioral Pattern
460
460 460
461
462 464
468
468 469 469 473 475 483
xviii
Contents
Back-End 3: Persistent Session Manager with a JDBC Store Testing a Tomcat Cluster with JDBC Persistent Session Manager Back-End 487 490
490
491 492 495 496 496
497
497 498 498
Summary
498
501
502
503 503
505
505 506 506
507
507 508 509 509 509 510
510
512 512 512 517 517 517 519 519 520
xix
Contents
Adding an <mbean> Element to the manager Context Using the manager Application on the Embedded Server 521 521
Summary Appendix A: Log4J Appendix B: Tomcat and IDEs Appendix C: Apache Ant Index
xx