Always Learning

Advanced Search

Tomcat 5 Unleashed

Tomcat 5 Unleashed

Lajos Moczar

Aug 2004, Paperback, 768 pages
ISBN13: 9780672326363
ISBN10: 0672326361
This title is ordered on demand which may result in extended delivery times.
  • Print pagePrint page
  • Email this pageEmail page
  • Write a reviewWrite a review
  • Share

Getting the most bang for their buck is a goal for every company, large or small. That is why open-source technologies are becoming so popular. However, organizations are often wary of the scalability, security and stability that open-source technologies offer. Tomcat Unleashed is a comprehensive guide that will show you how Tomcat 5.x can meet these expectations and more. Detailed, hands-on coverage of Tomcat 5.x will teach you how to deploy it at an enterprise level, as well as integrate it with other components, including databases, LDAP and web application frameworks. Get the most bang for your buck with Tomcat Unleashed.

Getting the most bang for their buck is a goal for every company, large or small. That is why open-source technologies are becoming so popular. However, organizations are often wary of the scalability, security and stability that open-source technologies offer. Tomcat Unleashed is a comprehensive guide that will show you how Tomcat 5.x can meet these expectations and more. Detailed, hands-on coverage of Tomcat 5.x will teach you how to deploy it at an enterprise level, as well as integrate it with other components, including databases, LDAP and web application frameworks. Get the most bang for your buck with Tomcat Unleashed.

Introduction.

I. TOMCAT FAST TRACK.

1. Tomcat Quickstart.

Introducing Tomcat.

Installing the Basic Tomcat 5.x Package.

Prerequisites.

Downloading Tomcat.

Installation.

Tomcat Directory Structure.

Starting Tomcat.

What Is a Web Application?

Your First JSP Page.

Installing the Windows Executable Tomcat 5.x Package.

Installing Tomcat 4.x.

Conclusion.

2. Configuration Basics.

Productionalizing the Distribution.

Tomcat 5 Directories.

Tomcat 5 Configuration Files.

server.xml.

Tomcat Architecture Basics.

server.xml Basics.

Web Application Loading.

Reorganizing Your Tomcat 5 Installation.

Creating a New Deployment Area.

Editing server.xml.

Creating a Context Definition.

Editing admin.xml and manager.xml.

Testing.

Productionalizing the Tomcat 4 Distribution.

Tomcat 4 Directories.

Tomcat 4 Configuration Files.

Tomcat 4 server.xml.

Adding a Context Definition for the unleashed Application.

Conclusion.

3. Administration Basics.

Introduction.

Running Tomcat 5.

Tomcat 5 bin files.

Tomcat 5 Run Options.

Running Tomcat 5 as a Service on Windows.

Tomcat 5 Resources.

Definitions.

Installing MySQL.

Downloading MySQL.

Installing MySQL.

Starting MySQL on Linux.

Starting MySQL on Windows.

Creating the Table.

Creating the Database Connection Pool.

Creating the JSP.

Testing.

Running Tomcat 4.

Tomcat 4 bin files.

Tomcat 4 Run Options.

Tomcat 4 Resources.

Conclusion.

4. Security Basics.

The Five Layers of Security.

Physical-Level Security.

Operating System–Level Security.

Network-Level Security.

Server-Level Security.

Application-Level Security.

Tomcat Security Basics.

Tomcat and OS Security.

Tomcat and Network Security.

Tomcat and Server Security.

Tomcat and Application Security.

Running Tomcat Securely.

Running Tomcat as a Nonroot User on Unix.

Running Tomcat as a Non-administrative User on Windows.

Tomcat 5 Authentication Example.

Creating the Password File.

Digesting Passwords.

Configuring the Memory Realm.

Editing web.xml.

Testing.

Running the Authentication Example on Tomcat 4.

Conclusion.

II. DEVELOPING TOMCAT-BASED WEB APPLICATIONS.

5. Overview of J2EE Application Development.

Web Applications.

What Is J2EE?

J2EE Tiers.

J2EE in a Services Model.

J2EE Containers.

J2EE Interfaces.

J2EE Specifications.

J2EE Reference Implementation.

Basic J2EE Concepts.

Web Containers.

Web Applications.

Servlets.

JSPs.

Scope.

Basic Objects.

HttpServlet.

ServletConfig.

ServletContext.

HttpServletRequest.

HttpServletResponse.

HttpSession.

Conclusion.

6. Web Application Development Principles.

Use What Works.

Development Methodologies.

Requirements and Design.

Prototyping.

Development Orientation.

Testing.

Web Application Development.

Planning.

Design.

Development and Testing.

Deployment.

Development Issues.

Technology.

Environment.

Software Resources.

Security.

Maintenance.

Application Design.

Conclusion.

7. Web Application Design.

Who Needs Design?

What Is Design?

What Makes and Breaks Designs.

What Makes for Good Design .

What Makes a Great Design .

What Breaks a Design.

The World of Design Fashions.

Design Agility.

Patterns…and the Evil Antipatterns.

To UML or Not to UML.

Basic J2EE Design Principles.

MVC.

Model 1 and Model 2.

Patterns in Action.

Design Pattern + Implementation = Framework.

Do You Want a Framework?

A Framework Menu.

Conclusion.

8. Setting Up a Development Environment.

What Makes an Environment?

The Five Key Elements.

The Key Principles.

IDEs.

Building Your Environment.

Setting Up the Directories.

Gathering the Tools.

Setting Up the Runtime Environment.

Setting Up the Core Tasks.

Setting Up Source Control.

Test and Production Environments.

Conclusion.

9. Developing with JSPs.

JSP Basics.

Directive Elements.

Scripting Elements.

Actions.

Scopes.

Taglibs.

EL.

A JSP Calendar.

First taglib.

Using JSTL.

Installing JSTL.

Using the Core and SQL Tag Libraries.

Using the SQL Tag Library with a Connection Pool.

Using the Functions Tag Library with Conditions.

JSPs as XML Documents.

Using the JSTL 1.0 Core and SQL Tag Libraries.

Conclusion.

10. Developing with Servlets.

Servlet Basics.

Responding to Requests.

Everything Has a Context.

Servlet Lifecycle.

Servlet Objects.

A Simple Servlet.

(Not) Using the Invoker Servlet.

My First Controller Servlet.

Requester JSP.

Scheduler Servlet.

The Helper Object.

The Reservation JavaBean.

Reservation Response JSP.

Assembling the Application.

Emailing from a Servlet.

One Servlet or Many.

Conclusion.

11. Web Application Basics.

The Web Application.

The Web Application and the J2EE Application.

Platform Roles.

How to Configure a Web Application.

Overview of Configuration Methods.

Configuration Testing Servlet.

Info Dumper Servlet.

Configuration Best Practices.

Java System Parameters.

Context Parameters.

Servlet Parameters.

Custom Configuration File.

JNDI Parameters.

Understanding web.xml.

General Parameters.

Context Parameters.

Filters and Filter Mappings.

Listeners.

Servlets and Servlet Mappings.

Session Configuration.

Welcome File List.

Error Pages.

JSP Configuration.

Security Information.

JNDI Parameters.

References.

Packaging Your Application.

Conclusion.

12. Developing Secure Applications.

Defining Web Application Security.

FORM Authentication.

Mapping Role Names.

Programmatic Security.

Sessions.

Writing a Session Listener.

Application Security Holes.

XSS Examples.

HTML Injection Example.

SQL Injection.

Writing Security Applications

Filter User Input.

Keep Sensitive Information Out of the Session.

Document Potential Hack Points.

Keep Comments Out.

Lock Down Resource Access.

Keep Current.

Conclusion.

13. Advanced Application Development.

Dynamic Output with XSLT.

XSLT Essentials.

XSLT Technologies.

Using an XSLT Filter.

Writing the XSLT Filter.

Converting the Content to XML.

Writing an Application Listener.

Writing the XSL Stylesheet.

XSLT in Action.

Using the XML Taglib for XSLT.

Using a Controller Servlet for XSLT.

Guidelines for Using XSL in Web Applications.

Logging.

Log4j Quickstart.

Basic Logging.

Custom Handling of XSLT Errors.

Automating Alerts.

Using Transactions.

Installing JOTM.

Creating the User Schedules.

Testing.

Conclusion.

III. TOMCAT ADMINISTRATION.

14. EnterpriseTomcat.

What Is the “Enterprise?”

What Is Open Source Software?

The OSS Enterprise.

Rules for Starting an OSS Enterprise .

Rule #1: Know Your Components.

Rule #2: Avoid Version Mania!

Rule #3: Plan, Plan, Plan.

Rule #4: Don’t Take Security for Granted.

Rule #5: Don’t Put All Your Eggs in One Basket.

Rule #6: Choose Your Path Carefully.

Rule #7: Have a Support Plan .

Rule #8: Understand OSS Licenses .

Tomcat in an OSS-Based Enterprise.

Rules for Starting an OSS Enterprise with Tomcat.

Tomcat and OSS J2EE.

Conclusion.

15. Tomcat Architecture.

The Tomcat Source Code.

The Tomcat 5 Source Code.

The Tomcat 4 Source Code.

Overall Architecture.

Tomcat Connector Architecture.

Coyote Request Processing.

Tomcat Request Processing.

Tomcat Startup.

Class Loading.

JVM Class Loaders.

Tomcat Class Loaders.

All You Need to Know About XML and Java.

JMX, Managed Beans, and Tomcat.

Conclusion.

16. Tomcat Configuration.

Configuration Basics.

Tomcat Configuration Principles.

Virtual Hosts.

Web Applications.

Directories.

Logging.

Configuration of Tomcat 5 Container Elements.

Server.

Service.

Engine.

Host.

Context.

Configuration of Tomcat 5 Connector Elements.

Configuration of Tomcat 5 Nested Components.

DefaultContext.

LifecycleListener.

Loader.

Logger.

Manager.

Realm.

Resources.

Valve.

Configuration of Tomcat 5 Configuration Parameters.

Conclusion.

17. Administering Tomcat.

Installing Tomcat.

Preparing Your Environment.

Doing Your Research.

Productionalizing Tomcat.

Testing.

Upgrading Tomcat.

Upgrading Tomcat 4.x to 5.x.

Running Tomcat.

Using JSVC.

Running Tomcat from the Launcher.

Running Tomcat Tools.

Running Tomcat with a JRE.

Application Deployment.

Deployment on Startup.

Automatic Deployment While Tomcat Is Running.

Manual Deployment While Tomcat Is Running.

Application Deployment Rules.

Running Multiple Tomcat Instances.

Defining Fictitious Hosts.

Creating the New $CATALINA_HOME.

Creating Instance Directories.

Preparing the bin Files.

Preparing the conf Files.

Preparing the Context Descriptors.

Creating Sample Deployment Files.

Testing.

Starting Multiple Instances with the Launcher.

Running User-specific Instances.

Conclusion.

18. Tomcat Administration Tools.

Introducing the Manager Application.

Enabling Access to the Manager Application.

Using Manager via URL Commands.

Deploying an Application.

Removing a Web Application.

Listing Global JNDI Resources.

Using the HTML Version of Manager.

Using Manager with Ant.

Using Manager Effectively.

Introducing the Admin Application.

JMX and Tomcat.

Manager JMX Command.

Writing Our Own MBean.

A Simple MBean Web Page.

Conclusion.

19. Advanced Administration.

Balancer.

Session Persistence.

WebDAV.

ISP Considerations.

Organization.

Processes and Tools.

Running Multiple Tomcats.

Deployment Strategies.

User Directories.

Clustering.

Conclusion.

20. Tomcat—Web Server Integration.

Some History.

Integrating Tomcat and Apache with mod_jk.

Installing Apache.

Installing mod_jk.so.

Creating workers.properties.

Editing Apache httpd.conf.

Testing.

Using mod_jk with Multiple Tomcats.

Load Balancing with mod_jk.

Setting Up a Load Balancing Test.

Changing Load Balancing Behavior.

Session Management.

Mod_jk Performance and Tuning.

Integrating Tomcat and Apache 2 with mod_jk2 and Socket Channel.

Mod_jk2 Basics.

Downloading mod_jk2.

Configuring Tomcat for mod_jk2.

Configuring Apache for mod_jk2.

Testing.

Using mod_jk2 with Virtual Hosts.

Load Balancing with mod_jk2.

Integrating Tomcat and Apache with Mod_proxy.

Conclusion.

21. Administering JNDI Resources.

JNDI Basics.

Defining Resources in Tomcat.

Resource References.

JNDI Parameters.

Database Connections via JNDI.

Emailing with JNDI.

Getting JavaBeans from JNDI.

Writing a Resource Factory.

Conclusion.

22. Tomcat Security.

Tomcat and Enterprise Security.

LDAP Authentication.

Installing OpenLDAP.

Adding data to OpenLDAP.

Viewing Data in OpenLDAP.

Setting Up the JNDI Realm.

JAAS.

JAAS Authentication.

Using JAAS.

A Simple JAAS Example.

Setting up Tomcat for JAAS.

NT Domain Authentication.

Writing Your Own JAAS LoginModule.

Kerberos Authentication.

Testing the Krb5LoginModule.

Krb5LoginModule and Tomcat.

Where to Go Next with JAAS.

Single Sign-on with CAS.

Single Sign-on in Tomcat.

JDBCRealm.

DataSourceRealm.

SSL in Tomcat.

Creating Server-side Certificates.

Requiring SSL Communication.

Creating Client-side Certificates.

Best Practices.

Choosing the Right Realm.

Running Tomcat Securely.

Conclusion.

23. Tomcat Performance and Tuning.

Tomcat Tunables.

Load Testing.

Tuning Tomcat.

Connectors.

Memory.

Sessions.

Logging.

Request Pipelines.

Startup/Shutdown.

Authentication Mechanisms.

External Resources.

Appplication Testing.

Conclusion.

IV. ADVANCED TOPICS.

24. Customizing Tomcat.

Writing a MissingPageValve.

Simple MissingPageValve.

Writing a Response with the MissingPageValve.

The Final MissingPageValve.

Where to Go Next.

Writing a Listener.

Conclusion.

25. Embedded Tomcat.

Embedding Basics.

Creating the Sample Web Application.

Setting Up the WebAppServer Environment.

Writing the Code.

Testing the WebAppServer.

Running WebAppServer from a CD.

Enhancing the WebAppServer.

Conclusion.

26. Tomcat and EJB Servers.

Tomcat and OpenEJB.

A Simple EJB.

Writing the Bean.

Compiling and Deploying the Bean.

A Test JSP.

Configuring Tomcat.

Starting OpenEJB and Tomcat.

Tomcat and OpenEJB in the Same JVM.

Using the OpenEJB Web Application.

Using an Entity Bean.

Writing the EJB.

Configuring OpenEJB.

Compiling and Deploying the Bean.

Modifying the Scheduler Application.

Configuring Tomcat.

Starting OpenEJB and Tomcat.

Conclusion.

Index.

Lajos Moczar has worked with open source software since 1995. Through his business, Galatea IS Inc., he provides training and consulting services to companies around the world. His first book, The Cocoon Developer's Handbook, was published in 2002 by Sams Publishing. In addition to his writings on Tomcat and Cocoon, Lajos maintains his well-known FlashGuides at his site, http://www.galatea.com. When he is not writing books, he develops and sells Az, an integrated bundling of Apache and Tomcat. And when he is not writing software, he pursues his chief occupation of enjoying life in the Rockies with his wife and children.

Your opinions count

Be the first to review this product. Write your review now.