1. Trang chủ
  2. » Công Nghệ Thông Tin

Professional Apache Tomcat 6 docx

664 732 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

www.it-ebooks.info Wiley Publishing, Inc. Professional Apache Tomcat 6 Vivek Chopra Sing Li Jeff Genender ffirs.indd iiiffirs.indd iii 7/11/07 6:54:43 PM7/11/07 6:54:43 PM www.it-ebooks.info ffirs.indd iiffirs.indd ii 7/11/07 6:54:43 PM7/11/07 6:54:43 PM www.it-ebooks.info Professional Apache Tomcat 6 Introduction xxiii Chapter 1: Apache Tomcat 1 Chapter 2: Web Applications: Servlets, JSPs, and More 13 Chapter 3: Tomcat Installation 29 Chapter 4: Tomcat Architecture 51 Chapter 5: Basic Tomcat Configuration 69 Chapter 6: Advanced Tomcat Features 103 Chapter 7: Web Application Configuration 135 Chapter 8: Web Application Administration 173 Chapter 9: Class Loaders 205 Chapter 10: HTTP Connectors 221 Chapter 11: Tomcat and Apache HTTP Server 243 Chapter 12: Tomcat and IIS 285 Chapter 13: JDBC Connectivity 309 Chapter 14: Tomcat Security 335 Chapter 15: Shared Tomcat Hosting 387 Chapter 16: Monitoring and Managing Tomcat with JMX 419 Chapter 17: Clustering 455 Chapter 18: Embedded Tomcat 493 Chapter 19: Logging 505 Chapter 20: Performance Testing 533 Chapter 21: Performance Tuning 561 Appendix A: Tomcat and IDEs 585 Appendix B: Apache Ant 597 Index 621 ffirs.indd iffirs.indd i 7/11/07 6:54:42 PM7/11/07 6:54:42 PM www.it-ebooks.info ffirs.indd iiffirs.indd ii 7/11/07 6:54:43 PM7/11/07 6:54:43 PM www.it-ebooks.info Wiley Publishing, Inc. Professional Apache Tomcat 6 Vivek Chopra Sing Li Jeff Genender ffirs.indd iiiffirs.indd iii 7/11/07 6:54:43 PM7/11/07 6:54:43 PM www.it-ebooks.info Professional Apache Tomcat 6 Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-471-75361-2 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Library of Congress Cataloging-in-Publication Data Chopra, Vivek. Professional Apache Tomcat 6 / Vivek Chopra, Sing Li, and Jeff Genender. p. cm. Includes index. ISBN 978-0-471-75361-2 (paper/website) 1. Apache Tomcat. 2. Web servers. 3. Web site development. 4. Internet programming. I. Li, Sing. II. Genender, Jeff M. III. Title. TK5105.8885.A63C47 2007 005.7'1376—dc22 2007020134 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for per- mission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indian- apolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent profes- sional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. ffirs.indd ivffirs.indd iv 7/11/07 6:54:44 PM7/11/07 6:54:44 PM www.it-ebooks.info To Rebecca and Rohan, thanks for all your patience and support. —Vivek To my guiding light and spiritual support for the last two decades, Kim. —Sing To my wonderful wife, Nazarena, and my children, Madisyn, Weston, and Coleton. I could not have done this without you. —Jeff ffirs.indd vffirs.indd v 7/11/07 6:54:45 PM7/11/07 6:54:45 PM www.it-ebooks.info ffirs.indd viffirs.indd vi 7/11/07 6:54:45 PM7/11/07 6:54:45 PM www.it-ebooks.info About the Authors Vivek Chopra has more than 13 years of experience as a software architect, developer, and team lead and has worked in a number of Silicon Valley companies and startups. He writes actively on technology and is the author of more than half a dozen books on Java, open source software, XML, and Web services. Vivek has pending patents on Web service technologies, and has been a Java Community Process (JCP) member for the past three years. He also serves on the expert group for JSR 280 (XML API for Java ME). Sing Li (who was bitten by the microcomputer bug in the late 1970s) has grown up with the Micropro- cessor Age. His first personal computer was a $99 do-it-yourself Netronics COSMIC ELF with 256 bytes of memory, mail-ordered from the back pages of Popular Electronics magazine. A 20-year industry vet- eran, Sing is a system developer, open source software contributor, and freelance writer specializing in Java technology, and embedded and distributed systems architecture. He regularly writes for several popular technical journals and e-zines, and is the creator of the “Internet Global Phone,” one of the very first Internet phones available. He has authored and co-authored a number of books across diverse tech- nical disciplines including Geronimo, Tomcat, JSP, servlets, XML, Jini, media streaming, device drivers, and JXTA. Jeff Genender has over 18 years of software architecture, team lead, and development experience in multiple industries. Jeff is an active committer and Project Management Committee (PMC) member for Apache Geronimo, and a committer on OpenTerracotta, OpenEJB, ServiceMix, and Mojo (Maven plug- ins). Jeff also serves as a member of the Java Community Process (JCP) expert group for JSR-313 (Java Platform, Enterprise Edition 6 [Java EE 6] Specification) as a representative of the Apache Software Foundation. Jeff is an open source evangelist and has successfully brought open source development efforts, initiatives, and success stories into a number of Global 2000 companies, saving these organiza- tions millions in licensing costs. ffirs.indd viiffirs.indd vii 7/11/07 6:54:45 PM7/11/07 6:54:45 PM www.it-ebooks.info [...]... Standalone Understanding Tomcat Workers 2 46 2 46 Multiple Tomcat Workers Configuring Apache Server to Work with Multiple Tomcat Workers — the workers.properties File 2 46 247 Connecting Tomcat with Apache 251 Tomcat 6 Configuration Apache Web Server Configuration Using the mod_ jk Module Using the mod_proxy Module 251 252 253 259 Configuring SSL for Apache Web Server 263 Configuring mod_ssl for Apache Testing... Performance Bottlenecks Diagnosing Tomcat Performance Issues Tomcat Performance Tuning Tips Tuning the JVM Parameters Precompiling JSPs 537 538 542 554 555 558 558 559 561 561 562 563 564 564 566 567 569 xxi www.it-ebooks.info ftoc.indd xxi 7/11/07 1:48:52 PM Contents Tuning Tomcat Configuration Using Web Servers for Static Content, When Appropriate Summary 571 582 584 Appendix A: Tomcat and IDEs 585 Eclipse... Recipes 60 2 Building Web Applications with Ant Compiling JSPs Reusable Ant Scripts Using Property Files and Command-Line Parameters Build Logs Build Notifications via E-mail Ant and Source Control Systems Automated Testing 60 2 60 8 60 9 61 0 61 1 61 3 61 4 Continuous Integration Ant Task Reference Summary 61 5 61 5 61 9 Index 62 1 xxii www.it-ebooks.info ftoc.indd xxii 7/11/07 1:48:52 PM Introduction Professional Apache. .. Clustering Benefits 4 56 Scalability and Clustering The Need for High Availability 4 56 457 Clustering Basics 457 Master-Backup Topological Pattern Fail-Over Behavioral Pattern 457 458 Tomcat 6 Clustering Model 459 Load Balancing Session Sharing 460 461 Working with Tomcat 6 Clustering 465 Session Management in Tomcat 6 The Role of Cookies and Modern Browsers Configuring a Tomcat 6 Cluster Common Front... book focuses on its primary audience — i.e., Tomcat administrators — and tries to provide what this audience needs as best as it can This is the third edition in our Apache Tomcat series Our first edition, Professional Apache Tomcat, covered Tomcat versions 3 and 4 The second edition, Professional Apache Tomcat 5, focused primarily on Tomcat 5 Since then, Tomcat has released a new edition, and hence... Pacifico Tim Tate www.it-ebooks.info ffirs.indd ix 7/11/07 6: 54:45 PM www.it-ebooks.info ffirs.indd x 7/11/07 6: 54: 46 PM Contents Introduction xxiii Chapter 1: Apache Tomcat 1 Humble Beginnings: The Apache Project The Apache Software Foundation Tomcat 2 3 3 Distributing Tomcat: The Apache License Comparison with Other Licenses 4 5 The Big Picture: Java EE 6 Java APIs The Java EE APIs Java EE Application Servers... list; use the Tomcat User’s mailing list instead The archives for the list are at http://mail-archives apache. org/mod_mbox /tomcat- dev/ and http://marc.theaimsgroup.com/?l=tomcatdev, and directions for joining the list are at http:/ /tomcat .apache. org/lists.html Yet another place to monitor Tomcat developments is the IRC channel http:/ /tomcat apache. org/irc.html ❑ The Apache bug database: Apache uses a... in Apache Name-Based Virtual Hosting in Apache Virtual Hosting in Tomcat 388 389 392 395 Example Deployment Scenario Tomcat as a Standalone Server Tomcat with Apache Configuring Apache The Tomcat Host-Manager Application Virtual Hosting Issues: Stability, Security, and Performance Tuning Virtual Hosting Settings in Tomcat Creating Separate JVMs for Each Virtual Host Setting Memory Limits on the Tomcat. .. Parsers Summary 215 215 215 2 16 217 218 218 218 219 220 Chapter 10: HTTP Connectors HTTP Connectors 221 222 Tomcat 6 HTTP/1.1 Connector The Advanced NIO Connector Comet Asynchronous IO Support The Native APR Connector 223 227 228 228 Configuring Tomcat for CGI Support Configuring Tomcat for SSI Support 232 234 Configuring the Tomcat 6 SSI Servlet Configuring the Tomcat 6 SSI Filter 235 237 xv www.it-ebooks.info... Contents Running Tomcat Behind a Proxy Server Performance Tuning Tunable Configuration Attributes TCP/IP Stack Tuning Tips 238 239 239 240 Front-Ending Tomcat 6 with a Web Server Summary Chapter 11: Tomcat and Apache HTTP Server 241 242 243 The AJP Connector Architecture 244 The Native Code Apache Modules The Apache JServ Protocol The AJP Connector 244 245 245 Apache Web Server Frontend or Tomcat Standalone . Inc. Professional Apache Tomcat 6 Vivek Chopra Sing Li Jeff Genender ffirs.indd iiiffirs.indd iii 7/11/07 6: 54:43 PM7/11/07 6: 54:43 PM www.it-ebooks.info Professional Apache Tomcat 6 Published. AJP Connector 245 Apache Web Server Frontend or Tomcat Standalone 2 46 Understanding Tomcat Workers 2 46 Multiple Tomcat Workers 2 46 Configuring Apache Server to Work with Multiple Tomcat Workers. 263 Configuring mod_ssl for Apache 264 Testing the SSL-Enabled Apache Setup 269 SSL-Enabled Apache- Tomcat Setup 271 Tomcat Load Balancing with Apache 273 Changing CATALINA_HOME in the Tomcat Startup Files

Ngày đăng: 30/03/2014, 05:20

Xem thêm: Professional Apache Tomcat 6 docx

TỪ KHÓA LIÊN QUAN

Mục lục

    What’s Changed Since the Second Edition

    How to Use This Book

    Humble Beginnings: The Apache Project

    The Apache Software Foundation

    The Big Picture: Java EE

    Tomcat and Web Servers

    Chapter 2: Web Applications: Servlets, JSPs, and More

    A Brief History of Web Applications

    Building and Distributing Web Applications

    Installing the Java Virtual Machine

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN