Cover image for Practical mod_perl

Book description

mod_perl embeds the popular programming language Perl in the Apache web server, giving rise to a fast and powerful web programming environment. Practical mod_perl is the definitive book on how to use, optimize, and troubleshoot mod_perl. New mod_perl users will learn how to quickly and easily get mod_perl compiled and installed. But the primary purpose of this book is to show you how to take full advantage of mod_perl: how to make a mod_perl-enabled Web site as fast, flexible, and easily-maintainable as possible. The authors draw from their own personal experience in the field, as well as the combined experience of the mod_perl community, to present a rich and complete picture of how to set up and maintain a successful mod_perl site. This book is also the first book to cover the "next generation" of mod_perl: mod_perl 2.0, a completely rewritten version of mod_perl designed for integration with Apache 2.0, which for the first time supports threads. The book covers the following topics, and more:

  • Configuring mod_perl optimally for your web site

  • Porting and optimizing programs for a mod_perl environment

  • Performance tuning: getting the very fastest performance from your site

  • Controlling and monitoring the server to circumvent crashes and clogs

  • Integrating with databases efficiently and painlessly

  • Debugging tips and tricks

  • Maximizing security

Written for Perl web developers and web administrators, Practical mod_perl is an extensive guide to the nuts and bolts of the powerful and popular combination of Apache and mod_perl. From writing and debugging scripts to keeping your server running without failures, the techniques in this book will help you squeeze every ounce of power out of your server. True to its title, this is the practical guide to mod_perl.

Table of Contents

  1. Practical mod_perl
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. Preface
      1. What You Need to Know
      2. Who This Book Is For
      3. How This Book Is Organized
      4. Reference Sections
      5. Filesystem Conventions
      6. Apache and Perl Versions
      7. Typographic Conventions
      8. Command Interpreter Program (Shell) Conventions
      9. Installing Perl Modules
        1. Manual Installation
        2. Prerequisites Needed to Install Perl Modules on Windows
        3. Building a Perl Module
        4. Using the CPAN Shell
        5. Using the Perl Package Manager
      10. How to Contact Us
      11. Acknowledgments
    3. I. mod_perl Administration
      1. 1. Introducing CGI and mod_perl
        1. 1.1. A Brief History of CGI
          1. 1.1.1. The HTTP Protocol
          2. 1.1.2. The Common Gateway Interface Specification
          3. 1.1.3. Apache CGI Handling with mod_cgi
        2. 1.2. The Apache 1.3 Server Model
          1. 1.2.1. Forking
          2. 1.2.2. CGI Scripts Under the Forking Model
          3. 1.2.3. Performance Drawbacks of Forking
        3. 1.3. The Development of mod_perl 1.0
          1. 1.3.1. Running CGI Scripts with mod_perl
        4. 1.4. Apache 1.3 Request Processing Phases
          1. 1.4.1. Apache 1.3 Modules and the mod_perl 1.0 API
          2. 1.4.2. mod_perl 1.0 and the mod_perl API
        5. 1.5. References
      2. 2. Getting Started Fast
        1. 2.1. Installing mod_perl 1.0 in Three Steps
        2. 2.2. Installing mod_perl on Unix Platforms
          1. 2.2.1. Obtaining and Unpacking the Source Code
          2. 2.2.2. Building mod_perl
          3. 2.2.3. Installing mod_perl
        3. 2.3. Configuring and Starting the mod_perl Server
        4. 2.4. Installing mod_perl for Windows
          1. 2.4.1. Installing mod_perl with the Perl Package Manager
        5. 2.5. Preparing the Scripts Directory
        6. 2.6. A Sample Apache::Registry Script
          1. 2.6.1. Porting Existing CGI Scripts to mod_perl
        7. 2.7. A Simple mod_perl Content Handler
        8. 2.8. Is This All We Need to Know About mod_perl?
        9. 2.9. References
      3. 3. Installing mod_perl
        1. 3.1. Configuring the Source
          1. 3.1.1. Controlling the Build Process
          2. 3.1.2. Activating Callback Hooks
          3. 3.1.3. Activating Standard API Features
          4. 3.1.4. Enabling Extra Features
          5. 3.1.5. Reusing Configuration Parameters
          6. 3.1.6. Discovering Whether a Feature Was Enabled
          7. 3.1.7. Using an Alternative Configuration File
          8. 3.1.8. perl Makefile.PL Troubleshooting
            1. 3.1.8.1. A test compilation with your Makefile configuration failed...
            2. 3.1.8.2. Missing or misconfigured libgdbm.so
            3. 3.1.8.3. Undefined reference to `PL_perl_destruct_level'
        2. 3.2. Building mod_perl (make)
          1. 3.2.1. What Compiler Should Be Used to Build mod_perl?
          2. 3.2.2. make Troubleshooting
            1. 3.2.2.1. Undefined reference to `Perl_newAV'
            2. 3.2.2.2. Unrecognized format specifier for...
        3. 3.3. Testing the Server (make test)
          1. 3.3.1. Manual Testing
          2. 3.3.2. make test Troubleshooting
            1. 3.3.2.1. make test fails
            2. 3.3.2.2. mod_perl.c is incompatible with this version of Apache
            3. 3.3.2.3. make test......skipping test on this platform
            4. 3.3.2.4. make test fails due to misconfigured localhost entry
        4. 3.4. Installation (make install)
          1. 3.4.1. Manually Building a mod_perl-Enabled Apache
        5. 3.5. Installation Scenarios for Standalone mod_perl
          1. 3.5.1. The All-in-One Way
          2. 3.5.2. Building mod_perl and Apache Separately
          3. 3.5.3. When DSOs Can Be Used
          4. 3.5.4. Building mod_perl as a DSO via APACI
          5. 3.5.5. Building mod_perl as a DSO via APXS
        6. 3.6. Building mod_perl with Other Components
          1. 3.6.1. Installing mod_perl with PHP
          2. 3.6.2. Installing mod_perl with mod_ssl (+openssl)
          3. 3.6.3. Installing mod_perl with Apache-SSL (+openssl)
          4. 3.6.4. Installing mod_perl with Stronghold
        7. 3.7. Installing mod_perl with the CPAN.pm Interactive Shell
        8. 3.8. Installing mod_perl on Multiple Machines
        9. 3.9. Installation into a Nonstandard Directory
          1. 3.9.1. Installing Perl Modules into a Nonstandard Directory
          2. 3.9.2. Finding Modules Installed in Nonstandard Directories
            1. 3.9.2.1. Modifying @INC
            2. 3.9.2.2. Using the PERL5LIB environment variable
          3. 3.9.3. Using the CPAN.pm Shell with Nonstandard Installation Directories
          4. 3.9.4. Making a Local Apache Installation
          5. 3.9.5. Nonstandard mod_perl-Enabled Apache Installation
          6. 3.9.6. Nonstandard mod_perl-Enabled Apache Installation with CPAN.pm
        10. 3.10. How Can I Tell if mod_perl Is Running?
          1. 3.10.1. Checking the error_log File
          2. 3.10.2. Testing by Viewing /perl-status
          3. 3.10.3. Testing via Telnet
          4. 3.10.4. Testing via a CGI Script
          5. 3.10.5. Testing via lwp-request
        11. 3.11. General Notes
          1. 3.11.1. How Do I Make the Installation More Secure?
          2. 3.11.2. Can I Run mod_perl-Enabled Apache as suExec?
          3. 3.11.3. Should I Rebuild mod_perl if I Have Upgraded Perl?
          4. 3.11.4. mod_auth_dbm Nuances
        12. 3.12. References
      4. 4. mod_perl Configuration
        1. 4.1. Apache Configuration
          1. 4.1.1. Configuration Files
          2. 4.1.2. Configuration Directives
          3. 4.1.3. <Directory>, <Location>, and <Files> Sections
            1. 4.1.3.1. <Directory directoryPath> ... </Directory>
            2. 4.1.3.2. <Files filename > ... </Files>
            3. 4.1.3.3. <Location URI> ... </Location>
          4. 4.1.4. Merging <Directory>, <Location>, and <Files> Sections
          5. 4.1.5. Subgrouping of <Directory>, <Location>, and <Files> Sections
          6. 4.1.6. Options Directive Merging
          7. 4.1.7. MinSpareServers, MaxSpareServers, StartServers, MaxClients, and MaxRequestsPerChild
        2. 4.2. mod_perl Configuration
          1. 4.2.1. Alias Configurations
            1. 4.2.1.1. Running scripts located in the same directory under different handlers
          2. 4.2.2. <Location /perl> Sections
          3. 4.2.3. PerlModule and PerlRequire
          4. 4.2.4. Perl*Handlers
          5. 4.2.5. The handler( ) Subroutine
          6. 4.2.6. Investigating the Request Phases
          7. 4.2.7. Stacked Handlers
          8. 4.2.8. Perl Method Handlers
          9. 4.2.9. PerlFreshRestart
          10. 4.2.10. PerlSetEnv and PerlPassEnv
          11. 4.2.11. PerlSetVar and PerlAddVar
          12. 4.2.12. PerlSetupEnv
          13. 4.2.13. PerlWarn and PerlTaintCheck
        3. 4.3. The Startup File
          1. 4.3.1. A Sample Startup File
          2. 4.3.2. Syntax Validation
          3. 4.3.3. What Modules Should Be Added to the Startup File
          4. 4.3.4. The Confusion with use( ) in the Server Startup File
        4. 4.4. Apache Configuration in Perl
          1. 4.4.1. Constructing <Perl> Sections
          2. 4.4.2. Breaking Out of <Perl> Sections
          3. 4.4.3. Cheating with Apache->httpd_conf
          4. 4.4.4. Declaring Package Names in Perl Sections
          5. 4.4.5. Verifying <Perl> Sections
          6. 4.4.6. Saving the Perl Configuration
          7. 4.4.7. Debugging
        5. 4.5. Validating the Configuration Syntax
        6. 4.6. The Scope of mod_perl Configuration Directives
        7. 4.7. Apache Restarts Twice
        8. 4.8. Enabling Remote Server Configuration Reports
        9. 4.9. Tips and Tricks
          1. 4.9.1. Publishing Port Numbers Other Than 80
          2. 4.9.2. Running the Same Script from Different Virtual Hosts
        10. 4.10. Configuration Security Concerns
          1. 4.10.1. Using Only Absolutely Necessary Components
          2. 4.10.2. Taint Checking
          3. 4.10.3. Hiding Server Information
          4. 4.10.4. Making the mod_perl Server Inaccessible from the Outside
          5. 4.10.5. Protecting Private Status Locations
        11. 4.11. General Pitfalls
        12. 4.12. References
      5. 5. Web Server Control, Monitoring, Upgrade, and Maintenance
        1. 5.1. Starting the Server in Multi-Process Mode
        2. 5.2. Starting the Server in Single-Process Mode
        3. 5.3. Using kill to Control Processes
          1. 5.3.1. kill Signals for Stopping and Restarting Apache
          2. 5.3.2. Speeding Up Apache's Termination and Restart
          3. 5.3.3. Finding the Right Apache PID
        4. 5.4. Using apachectl to Control the Server
        5. 5.5. Validating Server Configuration
        6. 5.6. Setuid root Startup Scripts
          1. 5.6.1. Introduction to setuid Executables
          2. 5.6.2. Apache Startup Script's setuid Security
          3. 5.6.3. Sample setuid Apache Startup Script
        7. 5.7. Preparing for Machine Reboot
        8. 5.8. Upgrading a Live Server
          1. 5.8.1. Upgrading Intranet Servers
          2. 5.8.2. Upgrading 24 × 7 Internet Servers
            1. 5.8.2.1. The server cluster
            2. 5.8.2.2. The single server
              1. 5.8.2.2.1. Upgrading live server components by swapping machines
              2. 5.8.2.2.2. Upgrading a live server with port forwarding
              3. 5.8.2.2.3. Upgrading a live server with prepackaged components
              4. 5.8.2.2.4. Upgrading a live server using symbolic links
              5. 5.8.2.2.5. Upgrading Perl code
              6. 5.8.2.2.6. Moving files and restarting the server
              7. 5.8.2.2.7. Using CVS for code upgrades
          3. 5.8.3. Disabling Scripts and Handlers on a Live Server
            1. 5.8.3.1. Disabling code running under Apache::Registry
            2. 5.8.3.2. Disabling code running under other handlers
            3. 5.8.3.3. Disabling services with help from the frontend server
          4. 5.8.4. Scheduled Routine Maintenance
        9. 5.9. Three-Tier Server Scheme: Development, Staging, and Production
          1. 5.9.1. Starting a Personal Server for Each Developer
        10. 5.10. Web Server Monitoring
          1. 5.10.1. Interactive Monitoring
          2. 5.10.2. Apache::VMonitor—The Visual System and Apache Server Monitor
            1. 5.10.2.1. Prerequisites and configuration
            2. 5.10.2.2. Multi-processes and system overall status reporting mode
            3. 5.10.2.3. Single-process extensive reporting system
          3. 5.10.3. Automated Monitoring
            1. 5.10.3.1. mod_perl server watchdogs
        11. 5.11. Server Maintenance Chores
          1. 5.11.1. Handling Log Files
            1. 5.11.1.1. Scheduled log file rotation
            2. 5.11.1.2. Non-scheduled emergency log rotation
            3. 5.11.1.3. Centralized logging
          2. 5.11.2. Swapping Prevention
          3. 5.11.3. Limiting Resources Used by Apache Child Processes
            1. 5.11.3.1. OS-specific notes
          4. 5.11.4. Tracking and Terminating Hanging Processes
          5. 5.11.5. Limiting the Number of Processes Serving the Same Resource
          6. 5.11.6. Limiting the Request-Rate Speed (Robot Blocking)
        12. 5.12. References
      6. 6. Coding with mod_perl in Mind
        1. 6.1. Before You Start to Code
          1. 6.1.1. Accessing Documentation
          2. 6.1.2. The strict Pragma
          3. 6.1.3. Enabling Warnings
        2. 6.2. Exposing Apache::Registry Secrets
          1. 6.2.1. The First Mystery: Why Does the Script Go Beyond 5?
          2. 6.2.2. The Second Mystery—Inconsistent Growth over Reloads
        3. 6.3. Namespace Issues
          1. 6.3.1. The @INC Array
          2. 6.3.2. The %INC Hash
          3. 6.3.3. Name Collisions with Modules and Libraries
            1. 6.3.3.1. A first faulty scenario
            2. 6.3.3.2. A second faulty scenario
            3. 6.3.3.3. A quick but ineffective hackish solution
            4. 6.3.3.4. A first solution
            5. 6.3.3.5. A second solution
            6. 6.3.3.6. A third solution
        4. 6.4. Perl Specifics in the mod_perl Environment
          1. 6.4.1. exit( )
          2. 6.4.2. die( )
          3. 6.4.3. Global Variable Persistence
          4. 6.4.4. STDIN, STDOUT, and STDERR Streams
          5. 6.4.5. Redirecting STDOUT into a Scalar Variable
          6. 6.4.6. print( )
          7. 6.4.7. Formats
          8. 6.4.8. Output from System Calls
          9. 6.4.9. BEGIN blocks
          10. 6.4.10. END Blocks
        5. 6.5. CHECK and INIT Blocks
          1. 6.5.1. $^T and time( )
          2. 6.5.2. Command-Line Switches
            1. 6.5.2.1. Warnings
            2. 6.5.2.2. Taint mode
          3. 6.5.3. Compiled Regular Expressions
            1. 6.5.3.1. Matching patterns repeatedly
        6. 6.6. Apache::Registry Specifics
          1. 6.6.1. _ _END_ _ and _ _DATA_ _ Tokens
          2. 6.6.2. Symbolic Links
          3. 6.6.3. Return Codes
        7. 6.7. Transition from mod_cgi Scripts to Apache Handlers
          1. 6.7.1. Starting with a mod_cgi-Compatible Script
          2. 6.7.2. Converting into a Perl Content Handler
          3. 6.7.3. Converting to use the mod_perl API and mod_perl-Specific Modules
        8. 6.8. Loading and Reloading Modules
          1. 6.8.1. The @INC Array Under mod_perl
          2. 6.8.2. Reloading Modules and Required Files
            1. 6.8.2.1. Restarting the server
            2. 6.8.2.2. Using Apache::StatINC
            3. 6.8.2.3. Using Apache::Reload
            4. 6.8.2.4. Using dynamic configuration files
              1. 6.8.2.4.1. Writing configuration files
              2. 6.8.2.4.2. Reloading configuration files
              3. 6.8.2.4.3. Dynamically updating configuration files
        9. 6.9. Handling the "User Pressed Stop Button" Case
          1. 6.9.1. Detecting Aborted Connections
          2. 6.9.2. The Importance of Cleanup Code
            1. 6.9.2.1. Critical section
            2. 6.9.2.2. Safe resource locking and cleanup code
        10. 6.10. Handling Server Timeout Cases and Working with $SIG{ALRM}
        11. 6.11. Generating Correct HTTP Headers
        12. 6.12. Method Handlers: The Browse and See, Browse and View Example
        13. 6.13. References
    4. II. mod_perl Performance
      1. 7. Identifying Your Performance Problems
        1. 7.1. Looking at the Big Picture
        2. 7.2. Asking the Right Questions
        3. 7.3. References
      2. 8. Choosing a Platform for the Best Performance
        1. 8.1. Choosing the Right Operating System
          1. 8.1.1. mod_perl Support for the Operating System
          2. 8.1.2. Stability and Robustness
          3. 8.1.3. Good Memory Management
          4. 8.1.4. Avoiding Memory Leaks
          5. 8.1.5. Memory-Sharing Capabilities
          6. 8.1.6. The Real Cost of Support
          7. 8.1.7. Discontinued Products
          8. 8.1.8. Keeping Up with OS Releases
        2. 8.2. Choosing the Right Hardware
          1. 8.2.1. Machine Strength Demands According to Expected Site Traffic
          2. 8.2.2. A Single Strong Machine Versus Many Weaker Machines
          3. 8.2.3. Getting a Fast Internet Connection
          4. 8.2.4. Tuning I/O Performance
          5. 8.2.5. How Much Memory Is Enough?
          6. 8.2.6. Getting a Fault-Tolerant CPU
          7. 8.2.7. Detecting and Avoiding Bottlenecks
          8. 8.2.8. Solving Hardware Requirement Conflicts
        3. 8.3. References
      3. 9. Essential Tools for Performance Tuning
        1. 9.1. Server Benchmarking
          1. 9.1.1. ApacheBench
          2. 9.1.2. httperf
          3. 9.1.3. http_load
          4. 9.1.4. Other Web Server Benchmark Utilities
        2. 9.2. Perl Code Benchmarking
        3. 9.3. Process Memory Measurements
        4. 9.4. Apache::Status and Measuring Code Memory Usage
        5. 9.5. Code Profiling Techniques
          1. 9.5.1. Profiling with Devel::DProf
          2. 9.5.2. Profiling with Devel::SmallProf
        6. 9.6. References
      4. 10. Improving Performance with Shared Memory and Proper Forking
        1. 10.1. Sharing Memory
          1. 10.1.1. Calculating Real Memory Usage
          2. 10.1.2. Memory-Sharing Validation
            1. 10.1.2.1. Variable unsharing caused by regular expressions
            2. 10.1.2.2. Numerical versus string access to variables
          3. 10.1.3. Preloading Perl Modules at Server Startup
          4. 10.1.4. Preloading Registry Scripts at Server Startup
          5. 10.1.5. Module Initialization at Server Startup
            1. 10.1.5.1. Initializing DBI.pm
            2. 10.1.5.2. Initializing CGI.pm
          6. 10.1.6. Memory Preallocation
        2. 10.2. Forking and Executing Subprocessesfrom mod_perl
          1. 10.2.1. Forking a New Process
          2. 10.2.2. Freeing the Parent Process
          3. 10.2.3. Detaching the Forked Process
          4. 10.2.4. Avoiding Zombie Processes
          5. 10.2.5. A Complete Fork Example
          6. 10.2.6. Starting a Long-Running External Program
          7. 10.2.7. Starting a Short-Running External Program
          8. 10.2.8. Executing system( ) or exec( ) in the Right Way
        3. 10.3. References
      5. 11. Tuning Performance by Tweaking Apache's Configuration
        1. 11.1. Setting the MaxClients Directive
        2. 11.2. Setting the MaxRequestsPerChild Directive
        3. 11.3. Setting MinSpareServers, MaxSpareServers, and StartServers
        4. 11.4. KeepAlive
        5. 11.5. PerlSetupEnv
        6. 11.6. Reducing the Number of stat( ) Calls Made by Apache
        7. 11.7. Symbolic Links Lookup
        8. 11.8. Disabling DNS Resolution
        9. 11.9. Response Compressing
        10. 11.10. References
      6. 12. Server Setup Strategies
        1. 12.1. mod_perl Deployment Overview
        2. 12.2. Standalone mod_perl-Enabled Apache Server
        3. 12.3. One Plain and One mod_perl-Enabled Apache Server
          1. 12.3.1. Choosing the Target Installation Directories Layout
          2. 12.3.2. Configuration and Compilation of the Sources
            1. 12.3.2.1. Building the httpd_docs server
            2. 12.3.2.2. Building the httpd_perl server
          3. 12.3.3. Configuration of the Servers
            1. 12.3.3.1. Basic httpd_docs server configuration
            2. 12.3.3.2. Basic httpd_perl server configuration
        4. 12.4. One Light Non-Apache and One mod_perl-Enabled Apache Server
        5. 12.5. Adding a Proxy Server in httpd Accelerator Mode
        6. 12.6. The Squid Server and mod_perl
          1. 12.6.1. Pros and Cons
          2. 12.6.2. Light Apache, mod_perl, and Squid Setup Implementation Details
          3. 12.6.3. mod_perl and Squid Setup Implementation Details
        7. 12.7. Apache's mod_proxy Module
          1. 12.7.1. Concepts and Configuration Directives
            1. 12.7.1.1. ProxyPass
            2. 12.7.1.2. ProxyPassReverse
            3. 12.7.1.3. Security issues
          2. 12.7.2. Knowing the Proxypassed Connection Type
          3. 12.7.3. Buffering Feature
          4. 12.7.4. Closing Lingering Connections with lingerd
          5. 12.7.5. Caching Feature
          6. 12.7.6. Build Process
        8. 12.8. mod_rewrite Examples
        9. 12.9. Getting the Remote Server IP in the Backend Server in the Proxy Setup
        10. 12.10. Frontend/Backend Proxying with Virtual Hosts
          1. 12.10.1. Virtual Host Flavors
          2. 12.10.2. Dual-Server Virtual Host Configuration
          3. 12.10.3. Virtual Hosts and Main Server Interaction
          4. 12.10.4. Frontend Server Configuration
          5. 12.10.5. Backend Server Configuration
        11. 12.11. HTTP Authentication with Two Servers and a Proxy
        12. 12.12. When One Machine Is Not Enough for Your RDBMS DataBase and mod_perl
          1. 12.12.1. Server Requirements
          2. 12.12.2. The Problem
          3. 12.12.3. The Solution
          4. 12.12.4. Three Machine Model
        13. 12.13. Running More than One mod_perl Server on the Same Machine
        14. 12.14. SSL Functionality and a mod_perl Server
        15. 12.15. Uploading and Downloading Big Files
        16. 12.16. References
      7. 13. TMTOWTDI: Convenience and Habit Versus Performance
        1. 13.1. Apache::Registry PerlHandler Versus Custom PerlHandler
        2. 13.2. Apache::args Versus Apache::Request::param Versus CGI::param
        3. 13.3. Buffered Printing and Better print( ) Techniques
        4. 13.4. Interpolation, Concatenation, or List
        5. 13.5. Keeping a Small Memory Footprint
          1. 13.5.1. "Bloatware" Modules
          2. 13.5.2. Importing Symbols
        6. 13.6. Object Methods Calls Versus Function Calls
          1. 13.6.1. The Overhead with Light Subroutines
          2. 13.6.2. The Overhead with Heavy Subroutines
          3. 13.6.3. Are All Methods Slower Than Functions?
        7. 13.7. Using the Perl stat( ) Call's Cached Results
        8. 13.8. time( ) System Call Versus $r->request_time
        9. 13.9. Printing Unmodified Files
        10. 13.10. Caching and Pre-Caching
        11. 13.11. Caching with Memoize
        12. 13.12. Comparing Runtime Performance of Perl and C
          1. 13.12.1. Building Perl Extensions with XS and h2xs
          2. 13.12.2. The Benchmark
          3. 13.12.3. Inline.pm
          4. 13.12.4. Perl Extensions Conclusion
        13. 13.13. References
      8. 14. Defensive Measures for Performance Enhancement
        1. 14.1. Controlling Your Memory Usage
          1. 14.1.1. Defining the Minimum Shared Memory Size Threshold
            1. 14.1.1.1. Potential drawbacks of memory-sharing restrictions
          2. 14.1.2. Defining the Maximum Memory Size Threshold
          3. 14.1.3. Defining the Maximum Unshared Memory Size Threshold
        2. 14.2. Coding for a Smaller Memory Footprint
          1. 14.2.1. Memory Reuse
          2. 14.2.2. Big Input, Big Damage
          3. 14.2.3. Small Input, Big Damage
          4. 14.2.4. Think Production, Not Development
          5. 14.2.5. Passing Variables
          6. 14.2.6. Memory Leakage
        3. 14.3. Conclusion
        4. 14.4. References
      9. 15. Improving Performance Through Build Options
        1. 15.1. Server Size as a Function of Compiled-in Features
        2. 15.2. mod_status and ExtendedStatus On
        3. 15.3. DYNAMIC_MODULE_LIMIT Apache Build Option
        4. 15.4. Perl Build Options
        5. 15.5. Architecture-Specific Compile Options
        6. 15.6. References
      10. 16. HTTP Headers for Optimal Performance
        1. 16.1. Date-Related Headers
          1. 16.1.1. Date Header
          2. 16.1.2. Last-Modified Header
          3. 16.1.3. Expires and Cache-Control Headers
        2. 16.2. Content Headers
          1. 16.2.1. Content-Type Header
          2. 16.2.2. Content-Length Header
          3. 16.2.3. Entity Tags
        3. 16.3. Content Negotiation
          1. 16.3.1. The Vary Header
        4. 16.4. HTTP Requests
          1. 16.4.1. GET Requests
          2. 16.4.2. Conditional GET Requests
          3. 16.4.3. HEAD Requests
          4. 16.4.4. POST Requests
        5. 16.5. Avoiding Dealing with Headers
        6. 16.6. References
    5. III. Databases and mod_perl
      1. 17. Databases Overview
        1. 17.1. Volatile Databases
          1. 17.1.1. In-Memory Databases in a Single Process
          2. 17.1.2. In-Memory Databases Across Multiple Processes
        2. 17.2. Non-Volatile Databases
          1. 17.2.1. Flat-File Databases
          2. 17.2.2. Filesystem Databases
          3. 17.2.3. DBM Databases
          4. 17.2.4. Relational Databases
        3. 17.3. References
      2. 18. mod_perl Data-Sharing Techniques
        1. 18.1. Sharing the Read-Only Data in and Between Processes
        2. 18.2. Sharing Data Between Various Handlers
        3. 18.3. References
      3. 19. DBM and mod_perl
        1. 19.1. mod_perl and DBM
        2. 19.2. Resource Locking
          1. 19.2.1. Deadlocks
          2. 19.2.2. Exclusive Locking Starvation
        3. 19.3. Flawed Locking Methods
        4. 19.4. Locking Wrappers Overview
        5. 19.5. Tie::DB_Lock
        6. 19.6. Examples
          1. 19.6.1. tie( )-ing Once and Forever
          2. 19.6.2. Read/Write Access
          3. 19.6.3. Storing Complex Data Structures
        7. 19.7. References
      4. 20. Relational Databases and mod_perl
        1. 20.1. Persistent Database Connections with Apache::DBI
          1. 20.1.1. Apache::DBI Connections
          2. 20.1.2. When to Use Apache::DBI (and When Not to Use It)
          3. 20.1.3. Configuring Apache::DBI
          4. 20.1.4. Debugging Apache::DBI
          5. 20.1.5. Caveats and Troubleshooting
            1. 20.1.5.1. Database locking risks
            2. 20.1.5.2. Transactions
            3. 20.1.5.3. Opening connections with different parameters
            4. 20.1.5.4. Cannot find the DBI handler
            5. 20.1.5.5. The morning bug
            6. 20.1.5.6. Apache:DBI does not work
            7. 20.1.5.7. Skipping connection cache during server startup
        2. 20.2. Improving Performance
          1. 20.2.1. Preopening DBI Connections
          2. 20.2.2. Improving Speed by Skipping ping( )
          3. 20.2.3. Efficient Record-Retrieval Techniques
          4. 20.2.4. mysql_use_result Versus mysql_store_result Attributes
          5. 20.2.5. Running Two or More Relational Databases
          6. 20.2.6. Caching prepare( ) Statements
        3. 20.3. DBI Debug Techniques
        4. 20.4. References
    6. IV. Debugging and Troubleshooting
      1. 21. Error Handling and Debugging
        1. 21.1. Warnings and Errors Explained
          1. 21.1.1. The Importance of Warnings
            1. 21.1.1.1. The diagnostics pragma
          2. 21.1.2. Curing "Internal Server Error" Problems
          3. 21.1.3. Making Use of the error_log
          4. 21.1.4. Displaying Errors to Users
        2. 21.2. Debugging Code in Single-Server Mode
        3. 21.3. Tracing System Calls
        4. 21.4. Tracing mod_perl-Specific Perl Calls
        5. 21.5. Debugging Perl Code
          1. 21.5.1. Locating and Correcting Syntax Errors
          2. 21.5.2. Using Apache::FakeRequest to Debug Apache Perl Modules
          3. 21.5.3. Using print( ) for Debugging
          4. 21.5.4. Using print( ) and Data::Dumper for Debugging
          5. 21.5.5. The Importance of a Good, Concise Coding Style
          6. 21.5.6. Introduction to the Perl Debugger
          7. 21.5.7. Interactive Perl Debugging Under mod_cgi
          8. 21.5.8. Noninteractive Perl Debugging Under mod_perl
          9. 21.5.9. Interactive mod_perl Debugging
            1. 21.5.9.1. ptkdb and interactive mod_perl debugging
        6. 21.6. Analyzing Dumped core Files
          1. 21.6.1. Getting Ready to Debug
          2. 21.6.2. Creating a Faulty Package
          3. 21.6.3. Dumping the core File
          4. 21.6.4. Analyzing the core File
          5. 21.6.5. Extracting the Backtrace Automatically
        7. 21.7. Hanging Processes: Detection and Diagnostics
          1. 21.7.1. Hanging Because of an Operating System Problem
          2. 21.7.2. When a Process Might Hang
          3. 21.7.3. Detecting Hanging Processes
          4. 21.7.4. Determination of the Reason
            1. 21.7.4.1. Using the Perl trace
            2. 21.7.4.2. Using the system calls trace
            3. 21.7.4.3. Using the interactive debugger
          5. 21.7.5. mod_perl gdb Debug Macros
        8. 21.8. Useful Debug Modules
          1. 21.8.1. B::Deparse
          2. 21.8.2. -D Runtime Option
          3. 21.8.3. Devel::Peek and Apache::Peek
          4. 21.8.4. Devel::Symdump and Apache::Symdump
          5. 21.8.5. Apache::Debug
          6. 21.8.6. Other Debug Modules
        9. 21.9. Looking Inside the Server
          1. 21.9.1. Apache::Status—Embedded Interpreter Status Information
            1. 21.9.1.1. Minimal configuration
            2. 21.9.1.2. Extended configuration
            3. 21.9.1.3. Usage
          2. 21.9.2. mod_status
        10. 21.10. References
      2. 22. Troubleshooting mod_perl
        1. 22.1. Configuration and Startup
          1. 22.1.1. libexec/libperl.so: open failed: No such file or directory
          2. 22.1.2. install_driver(Oracle) failed: Can't load `.../DBD/Oracle/Oracle.so' for module DBD::Oracle
          3. 22.1.3. Invalid command `PerlHandler'...
          4. 22.1.4. RegistryLoader: Translation of uri [...] to filename failed
        2. 22.2. Code Parsing and Compilation
          1. 22.2.1. Value of $x will not stay shared at - line 5
          2. 22.2.2. Value of $x may be unavailable at - line 5
          3. 22.2.3. Can't locate loadable object for module ...
          4. 22.2.4. Can't locate object method "get_handlers" ...
          5. 22.2.5. Missing right bracket at line ...
          6. 22.2.6. Can't load `.../auto/DBI/DBI.so' for module DBI
        3. 22.3. Runtime
          1. 22.3.1. foo ... at /dev/null line 0
          2. 22.3.2. Segfaults When Using XML::Parser
          3. 22.3.3. exit signal Segmentation fault (11)
          4. 22.3.4. CGI Code Is Returned as Plain Text Instead of Being Executed
          5. 22.3.5. rwrite returned -1
          6. 22.3.6. Global symbol "$foo" requires explicit package name
          7. 22.3.7. Use of uninitialized value at (eval 80) line 12
          8. 22.3.8. Undefined subroutine &Apache::ROOT::perl::test_2epl::some_function called at
          9. 22.3.9. Callback called exit
          10. 22.3.10. Out of memory!
          11. 22.3.11. syntax error at /dev/null line 1, near "line arguments:"
        4. 22.4. Shutdown and Restart
          1. 22.4.1. Evil Things Might Happen When Using PerlFreshRestart
          2. 22.4.2. [warn] child process 30388 did not exit, sending another SIGHUP
          3. 22.4.3. Processes Get Stuck on Graceful Restart
      3. 23. Getting Help and Online Resources
        1. 23.1. How to Report Problems
          1. 23.1.1. Getting the Backtrace from Core Dumps
          2. 23.1.2. Spinning Processes
        2. 23.2. Mailing List Etiquette
        3. 23.3. Resources
          1. 23.3.1. mod_perl
          2. 23.3.2. mod_perl Mailing Lists
          3. 23.3.3. Perl
          4. 23.3.4. Perl/CGI
          5. 23.3.5. Apache
          6. 23.3.6. DBI and SQL
          7. 23.3.7. Squid
          8. 23.3.8. CVS
          9. 23.3.9. Performance and Scalability
          10. 23.3.10. Web Security
    7. V. mod_perl 2.0
      1. 24. mod_perl 2.0: Installation and Configuration
        1. 24.1. What's New in Apache 2.0
        2. 24.2. What's New in Perl 5.6.0-5.8.0
        3. 24.3. What's New in mod_perl 2.0
          1. 24.3.1. Thread Support
          2. 24.3.2. Perl Interface to the APR and Apache APIs
          3. 24.3.3. Other New Features
          4. 24.3.4. Improved and More Flexible Configuration
          5. 24.3.5. Optimizations
        4. 24.4. Installing mod_perl 2.0
          1. 24.4.1. Installing from Source
          2. 24.4.2. Installing Binaries
        5. 24.5. Configuring mod_perl 2.0
          1. 24.5.1. Enabling mod_perl
          2. 24.5.2. Accessing the mod_perl 2.0 Modules
          3. 24.5.3. Startup File
          4. 24.5.4. Perl's Command-Line Switches
          5. 24.5.5. mod_perl 2.0 Core Handlers
            1. 24.5.5.1. modperl
            2. 24.5.5.2. perl-script
            3. 24.5.5.3. A simple response handler example
          6. 24.5.6. PerlOptions Directive
            1. 24.5.6.1. Enable
            2. 24.5.6.2. Clone
            3. 24.5.6.3. Parent
            4. 24.5.6.4. Perl*Handler
            5. 24.5.6.5. AutoLoad
            6. 24.5.6.6. GlobalRequest
            7. 24.5.6.7. ParseHeaders
            8. 24.5.6.8. MergeHandlers
            9. 24.5.6.9. SetupEnv
          7. 24.5.7. Thread-Mode-Specific Directives
            1. 24.5.7.1. PerlInterpStart
            2. 24.5.7.2. PerlInterpMax
            3. 24.5.7.3. PerlInterpMinSpare
            4. 24.5.7.4. PerlInterpMaxSpare
            5. 24.5.7.5. PerlInterpMaxRequests
            6. 24.5.7.6. PerlInterpScope
          8. 24.5.8. Retrieving Server Startup Options
        6. 24.6. Resources
      2. 25. Programming for mod_perl 2.0
        1. 25.1. Migrating to and Programming with mod_perl 2.0
          1. 25.1.1. The Shortest Migration Path
          2. 25.1.2. Migrating Configuration Files
            1. 25.1.2.1. PerlHandler
            2. 25.1.2.2. PerlSendHeader
            3. 25.1.2.3. PerlSetupEnv
            4. 25.1.2.4. PerlTaintCheck
            5. 25.1.2.5. PerlWarn
            6. 25.1.2.6. PerlFreshRestart
          3. 25.1.3. Code Porting
          4. 25.1.4. ModPerl::Registry Family
          5. 25.1.5. Method Handlers
          6. 25.1.6. Apache::StatINC Replacement
        2. 25.2. New Apache Phases and Corresponding Perl*Handlers
          1. 25.2.1. Server Configuration and Startup Phases
            1. 25.2.1.1. PerlOpenLogsHandler
            2. 25.2.1.2. PerlPostConfigHandler
            3. 25.2.1.3. PerlChildInitHandler
            4. 25.2.1.4. PerlChildExitHandler
          2. 25.2.2. Connection Phases
            1. 25.2.2.1. PerlPreConnectionHandler
            2. 25.2.2.2. PerlProcessConnectionHandler
              1. 25.2.2.2.1. Socket-based protocol module
              2. 25.2.2.2.2. Bucket brigade-based protocol module
          3. 25.2.3. HTTP Request Phases
        3. 25.3. I/O Filtering
          1. 25.3.1. I/O Filtering Concepts
            1. 25.3.1.1. Two methods for manipulating data
            2. 25.3.1.2. HTTP request versus connection filters
            3. 25.3.1.3. Multiple invocations of filter handlers
            4. 25.3.1.4. Blocking calls
          2. 25.3.2. Filter Configuration
          3. 25.3.3. Input Filters
            1. 25.3.3.1. Bucket brigade-based connection input filter
            2. 25.3.3.2. Bucket brigade-based HTTP request input filter
            3. 25.3.3.3. Stream-based HTTP request input filter
          4. 25.3.4. Output Filters
            1. 25.3.4.1. Stream-based HTTP request output filter
            2. 25.3.4.2. Another stream-based HTTP request output filter
            3. 25.3.4.3. Bucket brigade-based HTTP request output filter
    8. VI. Appendixes
      1. A. mod_perl Recipes
        1. A.1. Emulating the Authentication Mechanism
        2. A.2. Reusing Data from POST Requests
        3. A.3. Redirecting POST Requests
        4. A.4. Redirecting While Maintaining Environment Variables
        5. A.5. Handling Cookies
        6. A.6. Sending Multiple Cookies with the mod_perl API
        7. A.7. Sending Cookies in REDIRECT Responses
        8. A.8. CGI::params in the mod_perlish Way
        9. A.9. Sending Email from mod_perl
        10. A.10. mod_rewrite in Perl
        11. A.11. Setting PerlHandler Based on MIME Type
        12. A.12. Singleton Database Handles
        13. A.13. Terminating a Child Process on Request Completion
        14. A.14. References
      2. B. Apache Perl Modules
        1. B.1. Development-Stage Modules
          1. B.1.1. Apache::Reload—Automatically Reload Changed Modules
          2. B.1.2. Apache::PerlVINC—Allow Module Versioning in <Location> and <VirtualHost> blocks
          3. B.1.3. Apache::DProf—Hook Devel::DProf into mod_perl
          4. B.1.4. Apache::SmallProf—Hook Devel::SmallProf into mod_perl
          5. B.1.5. Apache::FakeRequest—Fake Request Object for Debugging
          6. B.1.6. Apache::test—Facilitate Testing of Apache::* Modules
        2. B.2. Modules to Aid Debugging
          1. B.2.1. Apache::DB—Hooks for the Interactive Perl Debugger
          2. B.2.2. Apache::Debug—Utilities for Debugging Embedded Perl Code
          3. B.2.3. Apache::DebugInfo—Send Debug Information to Client
          4. B.2.4. Apache::Leak—Module for Tracking Memory Leaks in mod_perl Code
          5. B.2.5. Apache::Peek—A Data Debugging Tool for the XS Programmer
          6. B.2.6. Apache::Symbol—Avoid the Mandatory `Subroutine Redefined' Warning
          7. B.2.7. Apache::Symdump—Symbol Table Snapshots
        3. B.3. Control and Monitoring Modules
          1. B.3.1. Apache::Watchdog::RunAway—Hanging Processes Monitor and Terminator
          2. B.3.2. Apache::VMonitor—Visual System and Apache Server Monitor
          3. B.3.3. Apache::SizeLimit—Limit Apache httpd Processes
          4. B.3.4. Apache::GTopLimit—Limit Apache httpd Processes
          5. B.3.5. Apache::TimedRedirect—Redirect URLs for a Given Time Period
          6. B.3.6. Apache::Resource—Limit Resources Used by httpd Children
          7. B.3.7. Apache::Status—Embedded Interpreter Status Information
        4. B.4. Server Configuration Modules
          1. B.4.1. Apache::ModuleConfig—Interface to Configuration API
          2. B.4.2. Apache::PerlSections—Utilities for Working with <Perl> Sections
          3. B.4.3. Apache::httpd_conf—Generate an httpd.conf File
          4. B.4.4. Apache::src—Methods for Locating and Parsing Bits of Apache Source Code
          5. B.4.5. Apache::ConfigFile—Parse an Apache-Style httpd.conf Configuration File
        5. B.5. Authentication-Phase Modules
        6. B.6. Authorization-Phase Modules
        7. B.7. Access-Phase Modules
          1. B.7.1. Stonehenge::Throttle—Limit Bandwith Consumption by IP Address
        8. B.8. Type Handlers
          1. B.8.1. Apache::MimeXML—mod_perl Mime Encoding Sniffer for XML Files
          2. B.8.2. Apache::MIMEMapper—Associates File Extensions with PerlHandlers
        9. B.9. Trans Handlers
          1. B.9.1. Apache::AddHostPath—Adds Some or All of the Hostname and Port to the URI
          2. B.9.2. Apache::ProxyPass—implement ProxyPass in Perl
          3. B.9.3. Apache::ProxyPassThru—Skeleton for Vanilla Proxy
          4. B.9.4. Apache::Throttle—Speed-Based Content Negotiation
          5. B.9.5. Apache::TransLDAP—Trans Handler Example
        10. B.10. Fixup Handlers
          1. B.10.1. Apache::RefererBlock—Block Request Based Upon "Referer" Header
          2. B.10.2. Apache::Usertrack—Emulate the mod_usertrack Apache Module
        11. B.11. Generic Content-Generation Modules
          1. B.11.1. Apache::Registry and Apache::PerlRun
          2. B.11.2. Apache::RegistryNG—Apache::Registry New Generation
          3. B.11.3. Apache::RegistryBB—Apache::Registry Bare Bones
          4. B.11.4. Apache::Request (libapreq)—Generic Apache Request Library
          5. B.11.5. Apache::Dispatch—Call PerlHandlers with the Ease of Registry Scripts
        12. B.12. Application-Specific Content-Generation Modules
          1. B.12.1. Apache::AutoIndex—Perl Replacement for the mod_autoindex and mod_dir Apache Modules
          2. B.12.2. Apache::WAP::AutoIndex—WAP Demonstration Module
          3. B.12.3. Apache::WAP::MailPeek—Demonstrate Use of WML Delivery
          4. B.12.4. Apache::Archive—Expose Archive Files Through the Apache Web Server
          5. B.12.5. Apache::Gateway—Implement a Gateway
          6. B.12.6. Apache::NNTPGateway—NNTP Interface for a mod_perl-Enabled Apache Web Server.
          7. B.12.7. Apache::PrettyPerl—Syntax Highlighting for Perl Files
          8. B.12.8. Apache::PrettyText—Reformat .txt Files for Client Display
          9. B.12.9. Apache::RandomLocation—Random File Display
          10. B.12.10. Apache::Stage—Manage a Staging Directory
          11. B.12.11. Apache::Roaming—A mod_perl Handler for Roaming Profiles
          12. B.12.12. Apache::Backhand—Write mod_backhand Functions in Perl
        13. B.13. Database Modules
          1. B.13.1. Apache::DBI—Initiate a Persistent Database Connection
          2. B.13.2. Apache::OWA—Oracle's PL/SQL Web Toolkit for Apache
          3. B.13.3. Apache::Sybase::CTlib—Persistent CTlib Connection Management for Apache
        14. B.14. Toolkits and Frameworks for Content-Generation and Other Phases
          1. B.14.1. Apache::ASP—Active Server Pages for Apache with mod_perl
          2. B.14.2. Apache::AxKit—XML Toolkit for mod_perl
          3. B.14.3. HTML::Embperl—Embed Perl into HTML
          4. B.14.4. Apache::EmbperlChain—Process Embedded Perl in HTML in the OutputChain
          5. B.14.5. Apache::ePerl—Embedded Perl 5 Language
          6. B.14.6. Apache::iNcom—E-Commerce Framework
          7. B.14.7. Apache::Mason—Perl-Based Web Site Development and Delivery System
          8. B.14.8. Apache::PageKit—Web Applications Framework
          9. B.14.9. Template Toolkit—Template Processing System
        15. B.15. Output Filters and Layering Modules
          1. B.15.1. Apache::OutputChain—Chain Stacked Perl Handlers
          2. B.15.2. Apache::Clean—mod_perl Interface Into HTML::Clean
          3. B.15.3. Apache::Filter—Alter the Output of Previous Handlers
          4. B.15.4. Apache::GzipChain—Compress HTML (or Anything) in the OutputChain
          5. B.15.5. Apache::PassFile—Send File via OutputChain
          6. B.15.6. Apache::Gzip—Auto-Compress Web Files with gzip
          7. B.15.7. Apache::Compress—Auto-Compress Web Files with gzip
          8. B.15.8. Apache::Layer—Layer Content Tree Over One or More Others
          9. B.15.9. Apache::Sandwich—Layered Document (Sandwich) Maker
          10. B.15.10. Apache::SimpleReplace—Simple Template Framework
          11. B.15.11. Apache::SSI—Implement Server-Side Includes in Perl
        16. B.16. Logging-Phase Handlers
          1. B.16.1. Apache::RedirectLogFix—Correct Status While Logging
          2. B.16.2. Apache::DBILogConfig—Logs Access Information in a DBI Database
          3. B.16.3. Apache::DBILogger—Tracks What's Being Transferred in a DBI Database
          4. B.16.4. Apache::DumpHeaders—Watch HTTP Transaction via Headers
          5. B.16.5. Apache::Traffic—Track Hits and Bytes Transferred on a Per-User Basis
        17. B.17. Core Apache Modules
          1. B.17.1. Apache::Module—Interface to Apache C Module Structures
          2. B.17.2. Apache::ShowRequest—Show Phases and Module Participation
          3. B.17.3. Apache::SubProcess—Interface to Apache Subprocess API
          4. B.17.4. Apache::Connection—Interface to the Apache conn_rec Data Structure
          5. B.17.5. Apache::Constants—Constants Defined in httpd.h
          6. B.17.6. Apache::ExtUtils—Utilities for Apache C/Perl Glue
          7. B.17.7. Apache::File—Advanced Functions for Manipulating Files on the Server Side
          8. B.17.8. Apache::Log—Interface to Apache Logging
          9. B.17.9. Apache::LogFile—Interface to Apache's Logging Routines
          10. B.17.10. Apache::Scoreboard—Perl Interface to Apache's scoreboard.h
          11. B.17.11. Apache::Server—Perl Interface to the Apache server_rec Struct
          12. B.17.12. Apache::Table—Perl Interface to the Apache Table Struct
          13. B.17.13. Apache::URI—URI Component Parsing and Unparsing
          14. B.17.14. Apache::Util—Perl Interface to Apache C Utility Functions
        18. B.18. Other Miscellaneous Modules
          1. B.18.1. Apache::Session—Maintain Session State Across HTTP Requests
          2. B.18.2. Apache::RequestNotes—Easy, Consistent Access to Cookie and Form Data Across Each Request Phase
          3. B.18.3. Apache::Cookie—HTTP Cookies Class
          4. B.18.4. Apache::Icon—Look Up Icon Images
          5. B.18.5. Apache::Include—Utilities for mod_perl/mod_include Integration
          6. B.18.6. Apache::Language—Perl Transparent Language Support for Apache Modules and mod_perl Scripts
          7. B.18.7. Apache::Mmap—Perl Interface to the mmap(2) System Call
          8. B.18.8. Apache::GD::Graph—Generate Graphs in an Apache Handler
          9. B.18.9. Apache::Motd—Provide motd (Message of the Day) Functionality to a Web Server
          10. B.18.10. Apache::ParseLog—Object-Oriented Perl Extension for Parsing Apache Log Files
          11. B.18.11. Apache::RegistryLoader—Compile Apache::Registry Scripts at Server Startup
          12. B.18.12. Apache::SIG—Override Apache Signal Handlers with Perl's Signal Handlers
          13. B.18.13. Apache::TempFile—Allocate Temporary Filenames for the Duration of a Request
          14. B.18.14. Xmms—Perl Interface to the xmms Media Player
          15. B.18.15. Module::Use—Log and Load Used Perl Modules
      3. C. ISPs Providing mod_perl Services
        1. C.1. Users Sharing a Single Web Server
        2. C.2. Users Sharing a Single Machine
        3. C.3. Giving Each User a Separate Machine (Colocation)
        4. C.4. Giving Each User a Virtual Machine
      4. D. The Template Toolkit
        1. D.1. Fetching and Installing the Template Toolkit
        2. D.2. Overview
        3. D.3. Typical Uses
        4. D.4. Template Toolkit Language
          1. D.4.1. Simple Template Example
        5. D.5. Processing Templates
        6. D.6. Apache/mod_perl Handler
        7. D.7. Apache::Template Module
        8. D.8. Hangman Application
          1. D.8.1. Hangman CGI Script
          2. D.8.2. Hangman with Modular Templates
          3. D.8.3. Hangman Plug-in
          4. D.8.4. Self-Contained Hangman Template
        9. D.9. References
      5. E. The AxKit XML Application Server
        1. E.1. Installing and Configuring AxKit
        2. E.2. Your First AxKit Page
          1. E.2.1. If Something Goes Wrong
          2. E.2.2. How it Works?
          3. E.2.3. XPath
        3. E.3. Dynamic Content
          1. E.3.1. Handling Form Parameters
          2. E.3.2. Handling Cookies
          3. E.3.3. Sending Email
          4. E.3.4. Handling Exceptions
          5. E.3.5. Utilities Taglib
          6. E.3.6. Executing SQL
        4. E.4. More XPathScript Details
          1. E.4.1. The XPathScript API
            1. E.4.1.1. Extracting values
            2. E.4.1.2. Declarative templates
        5. E.5. XSLT
          1. E.5.1. Anatomy of an XSLT Stylesheet
          2. E.5.2. Template Rules and Recursion
          3. E.5.3. Learning More
        6. E.6. Putting Everything Together
        7. E.7. More Reasons to Use AxKit
      6. F. HTTP Status Codes
        1. F.1. HTTP/1.0 Status Codes
        2. F.2. HTTP/1.1 Status Codes
        3. F.3. References
    9. Index
    10. About the Authors
    11. Colophon
    12. SPECIAL OFFER: Upgrade this ebook with O’Reilly