-
mod_perl Administration
-
Chapter 1 Introducing CGI and mod_perl
- A Brief History of CGI
- The Apache 1.3 Server Model
- The Development of mod_perl 1.0
- Apache 1.3 Request Processing Phases
- References
-
Chapter 2 Getting Started Fast
- Installing mod_perl 1.0 in Three Steps
- Installing mod_perl on Unix Platforms
- Configuring and Starting the mod_perl Server
- Installing mod_perl for Windows
- Preparing the Scripts Directory
- A Sample Apache::Registry Script
- A Simple mod_perl Content Handler
- Is This All We Need to Know About mod_perl?
- References
-
Chapter 3 Installing mod_perl
- Configuring the Source
- Building mod_perl (make)
- Testing the Server (make test)
- Installation (make install)
- Installation Scenarios for Standalone mod_perl
- Building mod_perl with Other Components
- Installing mod_perl with the CPAN.pm Interactive Shell
- Installing mod_perl on Multiple Machines
- Installation into a Nonstandard Directory
- How Can I Tell if mod_perl Is Running?
- General Notes
- References
-
Chapter 4 mod_perl Configuration
- Apache Configuration
- mod_perl Configuration
- The Startup File
- Apache Configuration in Perl
- Validating the Configuration Syntax
- The Scope of mod_perl Configuration Directives
- Apache Restarts Twice
- Enabling Remote Server Configuration Reports
- Tips and Tricks
- Configuration Security Concerns
- General Pitfalls
- References
-
Chapter 5 Web Server Control, Monitoring, Upgrade, and Maintenance
- Starting the Server in Multi-Process Mode
- Starting the Server in Single-Process Mode
- Using kill to Control Processes
- Using apachectl to Control the Server
- Validating Server Configuration
- Setuid root Startup Scripts
- Preparing for Machine Reboot
- Upgrading a Live Server
- Three-Tier Server Scheme: Development, Staging, and Production
- Web Server Monitoring
- Server Maintenance Chores
- References
-
Chapter 6 Coding with mod_perl in Mind
- Before You Start to Code
- Exposing Apache::Registry Secrets
- Namespace Issues
- Perl Specifics in the mod_perl Environment
- CHECK and INIT Blocks
- Apache::Registry Specifics
- Transition from mod_cgi Scripts to Apache Handlers
- Loading and Reloading Modules
- Handling the "User Pressed Stop Button" Case
- Handling Server Timeout Cases and Working with $SIG{ALRM}
- Generating Correct HTTP Headers
- Method Handlers: The Browse and See, Browse and View Example
- References
-
-
mod_perl Performance
-
Chapter 7 Identifying Your Performance Problems
- Looking at the Big Picture
- Asking the Right Questions
- References
-
Chapter 8 Choosing a Platform for the Best Performance
- Choosing the Right Operating System
- Choosing the Right Hardware
- References
-
Chapter 9 Essential Tools for Performance Tuning
- Server Benchmarking
- Perl Code Benchmarking
- Process Memory Measurements
- Apache::Status and Measuring Code Memory Usage
- Code Profiling Techniques
- References
-
Chapter 10 Improving Performance with Shared Memory and Proper Forking
- Sharing Memory
- Forking and Executing Subprocessesfrom mod_perl
- References
-
Chapter 11 Tuning Performance by Tweaking Apache's Configuration
- Setting the MaxClients Directive
- Setting the MaxRequestsPerChild Directive
- Setting MinSpareServers, MaxSpareServers, and StartServers
- KeepAlive
- PerlSetupEnv
- Reducing the Number of stat( ) Calls Made by Apache
- Symbolic Links Lookup
- Disabling DNS Resolution
- Response Compressing
- References
-
Chapter 12 Server Setup Strategies
- mod_perl Deployment Overview
- Standalone mod_perl-Enabled Apache Server
- One Plain and One mod_perl-Enabled Apache Server
- One Light Non-Apache and One mod_perl-Enabled Apache Server
- Adding a Proxy Server in httpd Accelerator Mode
- The Squid Server and mod_perl
- Apache's mod_proxy Module
- mod_rewrite Examples
- Getting the Remote Server IP in the Backend Server in the Proxy Setup
- Frontend/Backend Proxying with Virtual Hosts
- HTTP Authentication with Two Servers and a Proxy
- When One Machine Is Not Enough for Your RDBMS DataBase and mod_perl
- Running More than One mod_perl Server on the Same Machine
- SSL Functionality and a mod_perl Server
- Uploading and Downloading Big Files
- References
-
Chapter 13 TMTOWTDI: Convenience and Habit Versus Performance
- Apache::Registry PerlHandler Versus Custom PerlHandler
- Apache::args Versus Apache::Request::param Versus CGI::param
- Buffered Printing and Better print( ) Techniques
- Interpolation, Concatenation, or List
- Keeping a Small Memory Footprint
- Object Methods Calls Versus Function Calls
- Using the Perl stat( ) Call's Cached Results
- time( ) System Call Versus $r->request_time
- Printing Unmodified Files
- Caching and Pre-Caching
- Caching with Memoize
- Comparing Runtime Performance of Perl and C
- References
-
Chapter 14 Defensive Measures for Performance Enhancement
- Controlling Your Memory Usage
- Coding for a Smaller Memory Footprint
- Conclusion
- References
-
Chapter 15 Improving Performance Through Build Options
- Server Size as a Function of Compiled-in Features
- mod_status and ExtendedStatus On
- DYNAMIC_MODULE_LIMIT Apache Build Option
- Perl Build Options
- Architecture-Specific Compile Options
- References
-
Chapter 16 HTTP Headers for Optimal Performance
- Date-Related Headers
- Content Headers
- Content Negotiation
- HTTP Requests
- Avoiding Dealing with Headers
- References
-
-
Databases and mod_perl
-
Chapter 17 Databases Overview
- Volatile Databases
- Non-Volatile Databases
- References
-
Chapter 18 mod_perl Data-Sharing Techniques
- Sharing the Read-Only Data in and Between Processes
- Sharing Data Between Various Handlers
- References
-
Chapter 19 DBM and mod_perl
- mod_perl and DBM
- Resource Locking
- Flawed Locking Methods
- Locking Wrappers Overview
- Tie::DB_Lock
- Examples
- References
-
Chapter 20 Relational Databases and mod_perl
- Persistent Database Connections with Apache::DBI
- Improving Performance
- DBI Debug Techniques
- References
-
-
Debugging and Troubleshooting
-
Chapter 21 Error Handling and Debugging
- Warnings and Errors Explained
- Debugging Code in Single-Server Mode
- Tracing System Calls
- Tracing mod_perl-Specific Perl Calls
- Debugging Perl Code
- Analyzing Dumped core Files
- Hanging Processes: Detection and Diagnostics
- Useful Debug Modules
- Looking Inside the Server
- References
-
Chapter 22 Troubleshooting mod_perl
- Configuration and Startup
- Code Parsing and Compilation
- Runtime
- Shutdown and Restart
-
Chapter 23 Getting Help and Online Resources
- How to Report Problems
- Mailing List Etiquette
- Resources
-
-
mod_perl 2.0
-
Chapter 24 mod_perl 2.0: Installation and Configuration
- What's New in Apache 2.0
- What's New in Perl 5.6.0-5.8.0
- What's New in mod_perl 2.0
- Installing mod_perl 2.0
- Configuring mod_perl 2.0
- Resources
-
Chapter 25 Programming for mod_perl 2.0
- Migrating to and Programming with mod_perl 2.0
- New Apache Phases and Corresponding Perl*Handlers
- I/O Filtering
-
-
Appendixes
-
Appendix A mod_perl Recipes
- Emulating the Authentication Mechanism
- Reusing Data from POST Requests
- Redirecting POST Requests
- Redirecting While Maintaining Environment Variables
- Handling Cookies
- Sending Multiple Cookies with the mod_perl API
- Sending Cookies in REDIRECT Responses
- CGI::params in the mod_perlish Way
- Sending Email from mod_perl
- mod_rewrite in Perl
- Setting PerlHandler Based on MIME Type
- Singleton Database Handles
- Terminating a Child Process on Request Completion
- References
-
Appendix B Apache Perl Modules
- Development-Stage Modules
- Modules to Aid Debugging
- Control and Monitoring Modules
- Server Configuration Modules
- Authentication-Phase Modules
- Authorization-Phase Modules
- Access-Phase Modules
- Type Handlers
- Trans Handlers
- Fixup Handlers
- Generic Content-Generation Modules
- Application-Specific Content-Generation Modules
- Database Modules
- Toolkits and Frameworks for Content-Generation and Other Phases
- Output Filters and Layering Modules
- Logging-Phase Handlers
- Core Apache Modules
- Other Miscellaneous Modules
-
Appendix C ISPs Providing mod_perl Services
- Users Sharing a Single Web Server
- Users Sharing a Single Machine
- Giving Each User a Separate Machine (Colocation)
- Giving Each User a Virtual Machine
-
Appendix D The Template Toolkit
- Fetching and Installing the Template Toolkit
- Overview
- Typical Uses
- Template Toolkit Language
- Processing Templates
- Apache/mod_perl Handler
- Apache::Template Module
- Hangman Application
- References
-
Appendix E The AxKit XML Application Server
- Installing and Configuring AxKit
- Your First AxKit Page
- Dynamic Content
- More XPathScript Details
- XSLT
- Putting Everything Together
- More Reasons to Use AxKit
-
Appendix F HTTP Status Codes
- HTTP/1.0 Status Codes
- HTTP/1.1 Status Codes
- References
-
-
Colophon
- Title:
- Practical mod_perl
- By:
- Stas Bekman, Eric Cholet
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- May 2003
- Ebook Release:
- February 2009
- Pages:
- 928
- Print ISBN:
- 978-0-596-00227-5
- | ISBN 10:
- 0-596-00227-0
- Ebook ISBN:
- 978-0-596-10354-5
- | ISBN 10:
- 0-596-10354-9
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Practical mod_perl is a Thoroughbred horse. The Thoroughbred, also called the English running horse, originated in England from crossbreeding an Arabian horse and a Turkish horse to create the fastest racing horse in the world. One of the swiftest of all creatures and the fastest of horses, the Thoroughbred can maintain speeds of up to 45 miles per hour for more than a mile. This makes the Thoroughbred best-suited for racing, as well as for polo.
Thoroughbreds average 16 hands and 1,100 pounds in size. They have a leggy appearance, complemented by a long, light neck. Their heads are proportionate to their bodies, and their wide foreheads are often adorned with white markings. In addition to their strong physical characteristics, Thoroughbreds' personalities are noted for their strength, courage, determination, and will. However, due to their breeding, they also tend to be racy and nervous.
The integrity of the breed is closely maintained through stud documentation. Since 1977, every foal registered in the American Stud Book must be blood-typed to prove its origins. Linley Dolby was the production editor, and Rachel Wheeler was the copyeditor for Practical mod_perl. Sada Preisch and Jane Ellin proofread the book, and Claire Cloutier provided quality control. Tom Dinse wrote the index. Derek Di Matteo, Matt Hutchinson, and Jamie Peppard provided production assistance.
Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
Bret Kerr designed the interior layout, based on a series design by David Futato. This book was converted by Linda Mui and Andrew Savikas to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. This colophon was written by Linley Dolby.
