Toggle navigation
Home
Programming
Practical mod_perl
Preface
What You Need to Know
Who This Book Is For
How This Book Is Organized
Reference Sections
Filesystem Conventions
Apache and Perl Versions
Typographic Conventions
Command Interpreter Program (Shell) Conventions
Installing Perl Modules
How to Contact Us
Acknowledgments
Part I: mod_perl Administration
Chapter 1. Introducing CGI and mod_perl
1.1 A Brief History of CGI
1.2 The Apache 1.3 Server Model
1.3 The Development of mod_perl 1.0
1.4 Apache 1.3 Request Processing Phases
1.5 References
Chapter 2. Getting Started Fast
2.1 Installing mod_perl 1.0 in Three Steps
2.2 Installing mod_perl on Unix Platforms
2.3 Configuring and Starting the mod_perl Server
2.4 Installing mod_perl for Windows
2.5 Preparing the Scripts Directory
2.6 A Sample Apache::Registry Script
2.7 A Simple mod_perl Content Handler
2.8 Is This All We Need to Know About mod_perl?
2.9 References
Chapter 3. Installing mod_perl
3.1 Configuring the Source
3.2 Building mod_perl (make)
3.3 Testing the Server (make test)
3.4 Installation (make install)
3.5 Installation Scenarios for Standalone mod_perl
3.6 Building mod_perl with Other Components
3.7 Installing mod_perl with the CPAN.pm Interactive Shell
3.8 Installing mod_perl on Multiple Machines
3.9 Installation into a Nonstandard Directory
3.10 How Can I Tell if mod_perl Is Running?
3.11 General Notes
3.12 References
Chapter 4. mod_perl Configuration
4.1 Apache Configuration
4.2 mod_perl Configuration
4.3 The Startup File
4.4 Apache Configuration in Perl
4.5 Validating the Configuration Syntax
4.6 The Scope of mod_perl Configuration Directives
4.7 Apache Restarts Twice
4.8 Enabling Remote Server Configuration Reports
4.9 Tips and Tricks
4.10 Configuration Security Concerns
4.11 General Pitfalls
4.12 References
Chapter 5. Web Server Control, Monitoring, Upgrade, and Maintenance
5.1 Starting the Server in Multi-Process Mode
5.2 Starting the Server in Single-Process Mode
5.3 Using kill to Control Processes
5.4 Using apachectl to Control the Server
5.5 Validating Server Configuration
5.6 Setuid root Startup Scripts
5.7 Preparing for Machine Reboot
5.8 Upgrading a Live Server
5.9 Three-Tier Server Scheme: Development, Staging, and Production
5.10 Web Server Monitoring
5.11 Server Maintenance Chores
5.12 References
Chapter 6. Coding with mod_perl in Mind
6.1 Before You Start to Code
6.2 Exposing Apache::Registry Secrets
6.3 Namespace Issues
6.4 Perl Specifics in the mod_perl Environment
6.5 CHECK and INIT Blocks
6.6 Apache::Registry Specifics
6.7 Transition from mod_cgi Scripts to Apache Handlers
6.8 Loading and Reloading Modules
6.9 Handling the 'User Pressed Stop Button' Case
6.10 Handling Server Timeout Cases and Working with $SIG{ALRM}
6.11 Generating Correct HTTP Headers
6.12 Method Handlers: The Browse and See, Browse and View Example
6.13 References
Part II: mod_perl Performance
Chapter 7. Identifying Your Performance Problems
7.1 Looking at the Big Picture
7.2 Asking the Right Questions
7.3 References
Chapter 8. Choosing a Platform for the Best Performance
8.1 Choosing the Right Operating System
8.2 Choosing the Right Hardware
8.3 References
Chapter 9. Essential Tools for Performance Tuning
9.1 Server Benchmarking
9.2 Perl Code Benchmarking
9.3 Process Memory Measurements
9.4 Apache::Status and Measuring Code Memory Usage
9.5 Code Profiling Techniques
9.6 References
Chapter 10. Improving Performance with Shared Memory and Proper Forking
10.1 Sharing Memory
10.2 Forking and Executing Subprocessesfrom mod_perl
10.3 References
Chapter 11. Tuning Performance by Tweaking Apache's Configuration
11.1 Setting the MaxClients Directive
11.2 Setting the MaxRequestsPerChild Directive
11.3 Setting MinSpareServers, MaxSpareServers, and StartServers
11.4 KeepAlive
11.5 PerlSetupEnv
11.6 Reducing the Number of stat( ) Calls Made by Apache
11.7 Symbolic Links Lookup
11.8 Disabling DNS Resolution
11.9 Response Compressing
11.10 References
Chapter 12. Server Setup Strategies
12.1 mod_perl Deployment Overview
12.2 Standalone mod_perl-Enabled Apache Server
12.3 One Plain and One mod_perl-Enabled Apache Server
12.4 One Light Non-Apache and One mod_perl-Enabled Apache Server
12.5 Adding a Proxy Server in httpd Accelerator Mode
12.6 The Squid Server and mod_perl
12.7 Apache's mod_proxy Module
12.8 mod_rewrite Examples
12.9 Getting the Remote Server IP in the Backend Server in the Proxy Setup
12.10 Frontend/Backend Proxying with Virtual Hosts
12.11 HTTP Authentication with Two Servers and a Proxy
12.12 When One Machine Is Not Enough for Your RDBMS DataBase and mod_perl
12.13 Running More than One mod_perl Server on the Same Machine
12.14 SSL Functionality and a mod_perl Server
12.15 Uploading and Downloading Big Files
12.16 References
Chapter 13. TMTOWTDI: Convenience and Habit Versus Performance
13.1 Apache::Registry PerlHandler Versus Custom PerlHandler
13.2 Apache::args Versus Apache::Request::param Versus CGI::param
13.3 Buffered Printing and Better print( ) Techniques
13.4 Interpolation, Concatenation, or List
13.5 Keeping a Small Memory Footprint
13.6 Object Methods Calls Versus Function Calls
13.7 Using the Perl stat( ) Call's Cached Results
13.8 time( ) System Call Versus $r->request_time
13.9 Printing Unmodified Files
13.10 Caching and Pre-Caching
13.11 Caching with Memoize
13.12 Comparing Runtime Performance of Perl and C
13.13 References
Chapter 14. Defensive Measures for Performance Enhancement
14.1 Controlling Your Memory Usage
14.2 Coding for a Smaller Memory Footprint
14.3 Conclusion
14.4 References
Chapter 15. Improving Performance Through Build Options
15.1 Server Size as a Function of Compiled-in Features
15.2 mod_status and ExtendedStatus On
15.3 DYNAMIC_MODULE_LIMIT Apache Build Option
15.4 Perl Build Options
15.5 Architecture-Specific Compile Options
15.6 References
Chapter 16. HTTP Headers for Optimal Performance
16.1 Date-Related Headers
16.2 Content Headers
16.3 Content Negotiation
16.4 HTTP Requests
16.5 Avoiding Dealing with Headers
16.6 References
Part III: Databases and mod_perl
Chapter 17. Databases Overview
17.1 Volatile Databases
17.2 Non-Volatile Databases
17.3 References
Chapter 18. mod_perl Data-Sharing Techniques
18.1 Sharing the Read-Only Data in and Between Processes
18.2 Sharing Data Between Various Handlers
18.3 References
Chapter 19. DBM and mod_perl
19.1 mod_perl and DBM
19.2 Resource Locking
19.3 Flawed Locking Methods
19.4 Locking Wrappers Overview
19.5 Tie::DB_Lock
19.6 Examples
19.7 References
Chapter 20. Relational Databases and mod_perl
20.1 Persistent Database Connections with Apache::DBI
20.2 Improving Performance
20.3 DBI Debug Techniques
20.4 References
Part IV: Debugging and Troubleshooting
Chapter 21. Error Handling and Debugging
21.1 Warnings and Errors Explained
21.2 Debugging Code in Single-Server Mode
21.3 Tracing System Calls
21.4 Tracing mod_perl-Specific Perl Calls
21.5 Debugging Perl Code
21.6 Analyzing Dumped core Files
21.7 Hanging Processes: Detection and Diagnostics
21.8 Useful Debug Modules
21.9 Looking Inside the Server
21.10 References
Chapter 22. Troubleshooting mod_perl
22.1 Configuration and Startup
22.2 Code Parsing and Compilation
22.3 Runtime
22.4 Shutdown and Restart
Chapter 23. Getting Help and Online Resources
23.1 How to Report Problems
23.2 Mailing List Etiquette
23.3 Resources
Part V: mod_perl 2.0
Chapter 24. mod_perl 2.0: Installation and Configuration
24.1 What's New in Apache 2.0
24.2 What's New in Perl 5.6.0-5.8.0
24.3 What's New in mod_perl 2.0
24.4 Installing mod_perl 2.0
24.5 Configuring mod_perl 2.0
24.6 Resources
Chapter 25. Programming for mod_perl 2.0
25.1 Migrating to and Programming with mod_perl 2.0
25.2 New Apache Phases and Corresponding Perl*Handlers
25.3 I/O Filtering
Part VI: Appendixes
Appendix A. mod_perl Recipes
A.1 Emulating the Authentication Mechanism
A.2 Reusing Data from POST Requests
A.3 Redirecting POST Requests
A.4 Redirecting While Maintaining Environment Variables
A.5 Handling Cookies
A.6 Sending Multiple Cookies with the mod_perl API
A.7 Sending Cookies in REDIRECT Responses
A.8 CGI::params in the mod_perlish Way
A.9 Sending Email from mod_perl
A.10 mod_rewrite in Perl
A.11 Setting PerlHandler Based on MIME Type
A.12 Singleton Database Handles
A.13 Terminating a Child Process on Request Completion
A.14 References
Appendix B. Apache Perl Modules
B.1 Development-Stage Modules
B.2 Modules to Aid Debugging
B.3 Control and Monitoring Modules
B.4 Server Configuration Modules
B.5 Authentication-Phase Modules
B.6 Authorization-Phase Modules
B.7 Access-Phase Modules
B.8 Type Handlers
B.9 Trans Handlers
B.10 Fixup Handlers
B.11 Generic Content-Generation Modules
B.12 Application-Specific Content-Generation Modules
B.13 Database Modules
B.14 Toolkits and Frameworks for Content-Generation and Other Phases
B.15 Output Filters and Layering Modules
B.16 Logging-Phase Handlers
B.17 Core Apache Modules
B.18 Other Miscellaneous Modules
Appendix C. ISPs Providing mod_perl Services
C.1 Users Sharing a Single Web Server
C.2 Users Sharing a Single Machine
C.3 Giving Each User a Separate Machine (Colocation)
C.4 Giving Each User a Virtual Machine
Appendix D. The Template Toolkit
D.1 Fetching and Installing the Template Toolkit
D.2 Overview
D.3 Typical Uses
D.4 Template Toolkit Language
D.5 Processing Templates
D.6 Apache/mod_perl Handler
D.7 Apache::Template Module
D.8 Hangman Application
D.9 References
Appendix E. The AxKit XML Application Server
E.1 Installing and Configuring AxKit
E.2 Your First AxKit Page
E.3 Dynamic Content
E.4 More XPathScript Details
E.5 XSLT
E.6 Putting Everything Together
E.7 More Reasons to Use AxKit
Appendix F. HTTP Status Codes
F.1 HTTP/1.0 Status Codes
F.2 HTTP/1.1 Status Codes
F.3 References
Colophon
Remember the name: eTutorials.org
Copyright eTutorials.org 2008-2024. All rights reserved.