Apache Tomcat 7 Essentials

Apache Tomcat 7 Essentials
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Readymade solution for web technologies for migration/hosting and supporting environment for Tomcat 7
  • Tips, tricks, and best practices for web hosting solution providers for Tomcat 7
  • Content designed with practical approach and plenty of illustrations

Book Details

Language : English
Paperback : 294 pages [ 235mm x 191mm ]
Release Date : March 2012
ISBN : 1849516626
ISBN 13 : 9781849516624
Author(s) : Tanuj Khare
Topics and Technologies : All Books, Application Development, Java, Open Source

Table of Contents

Chapter 1: Installation of Tomcat 7
Chapter 2: Configuration and Deployment
Chapter 3: Performance Tuning
Chapter 4: Integration of Tomcat with the Apache Web Server
Chapter 5: Securing Tomcat 7
Chapter 6: Logging in Tomcat 7
Chapter 7: Troubleshooting in Tomcat
Chapter 8: Monitoring and Management of Tomcat 7
Chapter 9: Clustering in Tomcat 7
Chapter 10: Tomcat Upgrade
Chapter 11: Advanced Configuration for Apache Tomcat 7
  • Chapter 1: Installation of Tomcat 7
    • History of Tomcat
      • Tomcat support matrix
      • Features and enhancements of Apache Tomcat 7
        • Web application memory leak detection and prevention
        • Servlet 3.0
        • Improved logging
        • Aliases
    • Installation of Tomcat 7
      • How to download the Tomcat software
        • Binary package
        • RPM/exe
        • Source
      • Prerequisites for the Tomcat 7 installation
        • Installation of Java
        • Configuration of OS environment variables
      • Installation of Apache Tomcat 7
        • Installation on a Windows environment
        • Installation on a Linux environment
      • Startup and shutdown of Tomcat services
        • Services in Windows
        • Services in Linux
        • Startup script
        • Shutdown script
      • Verification of Tomcat status
    • Common problems and troubleshooting in installation
      • Error: Permission denied for the Java binary
      • Error: Tomcat is not able to find JAVA_HOME
      • Error: Error in the logs showing port already in use
    • Summary
    • Chapter 2: Configuration and Deployment
      • Configuration files and their usage
      • Configuration of Tomcat 7
        • DataSource configuration
          • JDBC
          • JNDI
          • DataSource
      • Comparison of the datasource for common databases
        • Tomcat Manager configuration
          • Enabling the Tomcat Manager
        • Context path
          • Enabling the context path
      • Deployment in Tomcat 7
        • Structure of the WebArchive
          • Archive Files
      • Types of deployment
        • Ways of application deployment in Tomcat 7
      • Common issues in deployment, configuration, and their troubleshooting
      • Summary
      • Chapter 3: Performance Tuning
        • Performance tuning for Tomcat 7
          • Why we need performance tuning?
        • How to start performance tuning
        • Tomcat components tuning
          • Types of connectors for Tomcat 7
            • Java HTTP Connector
            • Java AJP Connector
            • APR (AJP/HTTP) Connector
          • Thread optimization for Tomcat 7
            • Shared thread pool (shared executor)
            • Dedicated thread pool
            • Shared thread pool versus dedicated thread pool
            • maxThreads
            • maxKeepAlive
        • JVM tuning
          • Why do we need to tune the JDK for Tomcat?
            • JMAP (Memory Map)
          • How to increase the heap size in Tomcat 7
            • Garbage collection
          • JVM options
            • Standard options
            • Non-standard options
            • Parameters displayed in the logs for GC
            • SurvivorRatio
        • OS tuning
        • Summary
        • Chapter 4: Integration of Tomcat with the Apache Web Server
          • User request flow (web/application level)
          • Why the Apache HTTP server
          • Installation of the Apache HTTP
            • Apache HTTP installation on Windows
              • How to monitor the Apache service
            • Installation of Apache HTTP on Linux (non-DOS environment)
              • Apache Portable Runtime
          • Apache Jserv protocol
            • Installation and configuration of mod_jk
              • Installation of mod_jk
              • Configuration of mod_jk in Apache
            • mod_proxy configuration
            • Comparison between mod_jk and mod_proxy
          • IIS integration with Tomcat 7
            • Prerequisites
            • Steps for installation
          • Common issues and troubleshooting for integration
          • Summary
          • Chapter 5: Securing Tomcat 7
            • Tomcat Manager
            • Tomcat security permissions
              • catalina.properties
              • catalina.policy
                • System Code permissions
                • Catalina Code permissions (Tomcat core permission)
                • Web application permissions
              • tomcat-users.xml
              • server.xml
            • Enabling Tomcat Manager
              • How to enable the Tomcat Manager
            • Securing Tomcat 7 for production
              • Tomcat settings
                • Connector Port
                • Slimming of Tomcat application
                • Disable hot deployment
              • Non-Tomcat settings
                • Service as a separate user
                • Firewall
                • Password
            • SSL configuration on Tomcat 7
              • Types of SSL certificates
              • Process of installing SSL
            • Summary
            • Chapter 6: Logging in Tomcat 7
              • JULI
              • Loggers, appenders, and layouts
              • Types of logging in Tomcat 7
                • Application log
                • Server log
                • Console log
                • Access log
                • Host manager
              • Types of log levels in Tomcat 7
              • Log4j
                • Log level for log4j
                  • How to use log4j
                • Log level mapping
              • Values for Tomcat 7
              • Log analysis
                • Helpful commands for log analysis
              • Summary
              • Chapter 7: Troubleshooting in Tomcat
                • Common problem areas for web administrators
                • How to troubleshoot a problem
                  • Slowness issue in applications
                    • How to solve slowness issues in Tomcat 7
                    • Troubleshooting at the database level
                • How to obtain a thread dump in Tomcat 7
                  • Thread dump using Kill command
                  • Thread dump using jstack
                    • How to analyze the thread dump for Tomcat instance
                  • Thread dump analysis using Samurai
                  • Thread dump analysis using the Thread Dump Analyzer
                  • Errors and their solutions
                    • JVM (memory) issues
                    • Database-related issues
                • Web server benchmarking
                  • ApacheBench
                  • JMeter
              • Summary
                • Chapter 8: Monitoring and Management of Tomcat 7
                  • Different ways of monitoring
                  • Monitoring setup for a web application and database server
                  • Tomcat Manager in Tomcat 7
                  • Monitoring in Tomcat 7
                    • Summary of the Server Status of Tomcat 7
                      • Complete Server Status of Tomcat 7
                  • JConsole configuration on Tomcat 7
                    • Remote JMX enabling
                    • How to connect to the JConsole
                    • Different tabs for the JConsole and their features
                      • Memory overview
                      • Threads overview
                      • VM Summary and Overview
                      • MBeans
                  • Summary
                  • Chapter 9: Clustering in Tomcat 7
                    • What is a cluster?
                      • Benefits of clustering
                      • Disadvantages of clustering
                    • Clustering architecture
                      • Vertical clustering
                        • Advantages of vertical clustering
                        • Disadvantages of vertical clustering
                      • Horizontal clustering
                        • Advantages of horizontal clustering
                        • Disadvantages of horizontal clustering
                    • Vertical clustering in Apache Tomcat 7
                      • Installation of the Tomcat instance
                      • Configuration of a vertical cluster
                        • Configuration of instance 1
                        • Configuration of instance 2
                      • Apache web server configuration for vertical clustering
                    • Horizontal clustering in Apache Tomcat 7
                      • Installation of the Tomcat instance
                      • Configuration of the cluster
                        • Configuration of instance 1
                        • Configuration of instance 2
                      • Apache web server configuration for horizontal clustering
                    • Testing of the clustered instance
                    • Monitoring of Tomcat clustering
                    • Summary
                    • Chapter 10: Tomcat Upgrade
                      • Different types of environment
                        • Development environment
                        • Quality Assurance environment
                        • Staging environment
                        • Production environment
                      • Life cycle of the upgrade
                      • Tomcat upgrade from 6 to 7
                        • Prerequisites for Tomcat 7
                        • Installation of Tomcat 7 for the upgrade
                        • Configuration of Tomcat 7
                          • JVM configuration
                          • Database connection settings
                          • Application migration
                          • Alias configuration
                      • ITIL process implementation
                        • Availability management
                        • Capacity management
                        • Service Transition
                      • Summary
                      • Chapter 11: Advanced Configuration for Apache Tomcat 7
                        • Virtual hosting
                          • Name-based virtual hosting
                          • IP-based virtual hosting
                        • Virtual hosting in Tomcat 7
                        • Hostname aliases
                        • Multiple applications hosting on a single Tomcat 7 instance
                        • Multiple Tomcat environments—Development/QA/Stage/Production
                        • Tuning cache
                        • Optimization of Tomcat 7
                          • Running Tomcat 7 as a non privileged user
                        • Summary

                        Tanuj Khare

                        Tanuj Khare has worked as a professional in IT for six+ years. He is involved in Process improvements using ITIL framework and techniques (LEAN and Six sigma). He is MCSA and ITIL certified and has expertise in handling critical production server issues and has a track record of dealing with many complex problems. His quick resolution to issues faced in a production environment helped his team and clients a lot. Tanuj has SME (subject matter expertise) in Tomcat, weblogic, and JBOSS Server Administration. His experience includes working with large enterprise web hosting environment for J2EE container and small teams and his quick turnaround time resulted in on-time delivery. Apart from this, his technical expertise in root cause analysis, problem management, migration of enterprise application, and upgrade of web application servers is commendable. Until now he has done around 100+ enterprise application migrations. He has also done J2EE web and application upgrades and managed environments with 1,000+ middleware instances. Outside of work life, Tanuj enjoys playing table tennis and exploring new technologies. Tanuj is a good dancer. This is his first book.
                        Sorry, we don't have any reviews for this title yet.

                        Code Downloads

                        Download the code and support files for this book.

                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                        - 1 submitted: last submission 19 Sep 2013

                        Errata type: Code | Page No. 49 | Date: September 19, 2013


                        MySQL: The following mentioned code describes the datasource parameter
                        for the MySQL database:
                        <Resource name="jdbc/tomcat7" auth="Container" type="javax.sql.DataSource"
                          username="tomcat7" password="tomcat" maxActive="20" maxIdle="10"
                        Should be:
                        <Resource name="jdbc/tomcat7" auth="Container" type="javax.sql.DataSource"
                          username="tomcatuser" password="tomcat"
                          maxActive="100" maxIdle="30" maxWait="10000"/>

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Apache Tomcat 7 Essentials +    Haskell Data Analysis Cookbook =
                        50% Off
                        the second eBook
                        Price for both: $40.05

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Learn to install Tomcat 7 on Windows/Linux step-by-step and resolve any issues faced during installation
                        • Deploy multiple applications and troubleshoot any issues that occur during deployment
                        • Implement best practices in the production environment and learn tricks to reduce your day to day work load
                        • Dig deep into high availability architecture configuration (load balancing and clustering configuration) using front end web server like Apache and IIS
                        • Become an expert in tuning the Tomcat for performance
                        • Upgrade to Tomcat 7 successfully from the previous versions
                        • Configure Tomcat for Dev/QA/stage/production environment and indulge into maintenance tips
                        • Get familiar with thread dump analysis, monitoring JVM, database and OS related issues, and diagnose Tomcat 7 issues

                        In Detail

                        Apache Tomcat (or simply Tomcat) is an open source servlet container developed by the Apache Software Foundation (ASF). The latest major stable release, Apache Tomcat version 7 implements the Servlet 3 and JavaServer Pages 2 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services.

                        Apache Tomcat 7 Essentials follows a practical approach to teach installing, configuring, and maintaining Tomcat. It helps you to understand the middle architecture for hosting multiple websites and also provides the confidence to implement middleware support. It imparts to you the capacity to resolve migration issues and also provides regular maintenance solutions. This is the first and only book to cover upgrading to Tomcat 7 from previous versions.

                        The journey of the reader starts at the beginner level and ends at the expert level. The content is designed in such a way that it balances the theory and practical approach for understanding concepts related to handling middle ware and web issues.

                        In this book, you will go through a three-phase life cycle. The first cycle consists of installation, configuration of Tomcat 7 on different OS, and other configurations related to JDBC, port, deployment etc.

                        The second phase deals with the building of enterprise application setup and high availability architecture (clustering load balancing). The third and critical phase will teach you to handle critical issues, performance tuning, and best practices for various environment stacks like dev/QA/stage/production.

                        This book gives you a wider vision of using Tomcat 7 in web technologies and the skill to optimize their performance using Apache Tomcat 7.


                        This book is a step-by-step tutorial for anyone wanting to learn Apache Tomcat 7 from scratch. There are plenty of illustrations and examples to escalate you from a novice to an expert with minimal strain.

                        Who this book is for

                        If you are a J2EE administrator, migration administrator, technical architect, or a project manager for a web hosting domain, and are interested in Apache Tomcat 7, then this book is for you. If you are someone responsible for installation, configuration, and management of Tomcat 7, then too, this book will be of help to you.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software