Apache Cookbook: Solutions and Examples for Apache Administration

There's plenty of documentation on installing and configuring the Apache web server, but where do you find help for the day-to-day stuff, like adding common modules or fine-tuning your activity logging? That's easy. The new edition of the Apache Cookbook offers you updated solutions to the problems you're likely to encounter with the new versions of Apache.

Written by members of the Apache Software Foundation, and thoroughly revised for Apache versions 2.0 and 2.2, recipes in this book range from simple tasks, such installing the server on Red Hat Linux or Windows, to more complex tasks, such as setting up name-based virtual hosts or securing and managing your proxy server. Altogether, you get more than 200 timesaving recipes for solving a crisis or other deadline conundrums, with topics including:

  • Security
  • Aliases, Redirecting, and Rewriting
  • CGI Scripts, the suexec Wrapper, and other dynamic content techniques
  • Error Handling
  • SSL
  • Performance
This book tackles everything from beginner problems to those faced by experienced users. For every problem addressed in the book, you will find a worked-out solution that includes short, focused pieces of code you can use immediately. You also get explanations of how and why the code works, so you can adapt the problem-solving techniques to similar situations.

Instead of poking around mailing lists, online documentation, and other sources, rely on the Apache Cookbook for quick solutions when you need them. Then you can spend your time and energy where it matters most.

1110781470
Apache Cookbook: Solutions and Examples for Apache Administration

There's plenty of documentation on installing and configuring the Apache web server, but where do you find help for the day-to-day stuff, like adding common modules or fine-tuning your activity logging? That's easy. The new edition of the Apache Cookbook offers you updated solutions to the problems you're likely to encounter with the new versions of Apache.

Written by members of the Apache Software Foundation, and thoroughly revised for Apache versions 2.0 and 2.2, recipes in this book range from simple tasks, such installing the server on Red Hat Linux or Windows, to more complex tasks, such as setting up name-based virtual hosts or securing and managing your proxy server. Altogether, you get more than 200 timesaving recipes for solving a crisis or other deadline conundrums, with topics including:

  • Security
  • Aliases, Redirecting, and Rewriting
  • CGI Scripts, the suexec Wrapper, and other dynamic content techniques
  • Error Handling
  • SSL
  • Performance
This book tackles everything from beginner problems to those faced by experienced users. For every problem addressed in the book, you will find a worked-out solution that includes short, focused pieces of code you can use immediately. You also get explanations of how and why the code works, so you can adapt the problem-solving techniques to similar situations.

Instead of poking around mailing lists, online documentation, and other sources, rely on the Apache Cookbook for quick solutions when you need them. Then you can spend your time and energy where it matters most.

27.99 In Stock
Apache Cookbook: Solutions and Examples for Apache Administration

Apache Cookbook: Solutions and Examples for Apache Administration

by Rich Bowen, Ken Coar
Apache Cookbook: Solutions and Examples for Apache Administration

Apache Cookbook: Solutions and Examples for Apache Administration

by Rich Bowen, Ken Coar

eBook

$27.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

There's plenty of documentation on installing and configuring the Apache web server, but where do you find help for the day-to-day stuff, like adding common modules or fine-tuning your activity logging? That's easy. The new edition of the Apache Cookbook offers you updated solutions to the problems you're likely to encounter with the new versions of Apache.

Written by members of the Apache Software Foundation, and thoroughly revised for Apache versions 2.0 and 2.2, recipes in this book range from simple tasks, such installing the server on Red Hat Linux or Windows, to more complex tasks, such as setting up name-based virtual hosts or securing and managing your proxy server. Altogether, you get more than 200 timesaving recipes for solving a crisis or other deadline conundrums, with topics including:

  • Security
  • Aliases, Redirecting, and Rewriting
  • CGI Scripts, the suexec Wrapper, and other dynamic content techniques
  • Error Handling
  • SSL
  • Performance
This book tackles everything from beginner problems to those faced by experienced users. For every problem addressed in the book, you will find a worked-out solution that includes short, focused pieces of code you can use immediately. You also get explanations of how and why the code works, so you can adapt the problem-solving techniques to similar situations.

Instead of poking around mailing lists, online documentation, and other sources, rely on the Apache Cookbook for quick solutions when you need them. Then you can spend your time and energy where it matters most.


Product Details

ISBN-13: 9780596551568
Publisher: O'Reilly Media, Incorporated
Publication date: 12/21/2007
Series: Cookbooks (O'Reilly)
Sold by: Barnes & Noble
Format: eBook
Pages: 310
File size: 3 MB

About the Author

Rich Bowen is a member of the Apache Software Foundation, and has been involved in the Apache Web Server documentation project since 1998. He is part of the web team at Asbury College, where he does server administration and web app development. He is the co-author of Apache Cookbook, and is the author of The Definitive Guide to Apache mod_rewrite. Rich can be found online at http://wooga.drbacchus.com/ and on the #apache IRC channel on irc.freenode.net.

Ken Coar is a member of the Apache Software Foundation, the body that oversees Apache development. He is the author of Apache Server for Dummies (January 1998) and co-author of Apache Server Unleashed (March 2000). Ken has been responsible for fielding email sent to the Apache project, and his experience with that mailing list provided a foundation for this book.

Table of Contents

Prefacexi
1.Installation1
1.1Installing from Red Hat Linux's Packages2
1.2Installing Apache on Windows3
1.3Downloading the Apache Sources10
1.4Building Apache from the Sources11
1.5Installing with ApacheToolbox13
1.6Starting, Stopping, and Restarting Apache15
1.7Uninstalling Apache16
2.Adding Common Modules19
2.1Installing a Generic Third-Party Module20
2.2Installing mod_dav on a Unixish System20
2.3Installing mod_dav on Windows23
2.4Installing mod_perl on a Unixish System25
2.5Installing mod_php on a Unixish System27
2.6Installing mod_php on Windows28
2.7Installing the mod_snake Python Module29
2.8Installing mod_ssl30
3.Logging32
3.1Getting More Details in Your Log Entries35
3.2Getting More Detailed Errors36
3.3Logging POST Contents38
3.4Logging a Proxied Client's IP Address39
3.5Logging Client MAC Addresses39
3.6Logging Cookies40
3.7Not Logging Image Requests from Local Pages42
3.8Logging Requests by Day or Hour43
3.9Rotating Logs on the First of the Month44
3.10Logging Hostnames Instead of IP Addresses45
3.11Maintaining Separate Logs for Each Virtual Host46
3.12Logging Proxy Requests47
3.13Logging Errors for Virtual Hosts to Multiple Files48
3.14Logging Server IP Addresses49
3.15Logging the Referring Page50
3.16Logging the Name of the Browser Software51
3.17Logging Arbitrary Request Header Fields51
3.18Logging Arbitrary Response Header Fields52
3.19Logging Activity to a MySQL Database53
3.20Logging to syslog54
3.21Logging User Directories55
4.Virtual Hosts58
4.1Setting Up Name-Based Virtual Hosts59
4.2Designating One Name-Based Virtual Host as the Default61
4.3Setting Up Address-Based Virtual Hosts62
4.4Creating a Default Address-Based Virtual Host62
4.5Mixing Address-Based and Name-Based Virtual Hosts63
4.6Mass Virtual Hosting with mod_vhost_alias64
4.7Mass Virtual Hosting Using Rewrite Rules66
4.8SSL and Name-Based Virtual Hosts67
4.9Logging for Each Virtual Host68
4.10Splitting Up a LogFile69
4.11Port-Based Virtual Hosts70
4.12Displaying the Same Content on Several Addresses71
5.Aliases, Redirecting, and Rewriting72
5.1Showing Highlighted PHP Source Without Symlinking72
5.2Mapping a URL to a Directory74
5.3Creating a New URL for Existing Content75
5.4Giving Users Their Own URL76
5.5Aliasing Several URLs with a Single Directive79
5.6Mapping Several URLs to the Same CGI Directory79
5.7Creating a CGI Directory for Each User80
5.8Redirecting to Another Location81
5.9Redirecting Several URLs to the Same Destination83
5.10Permitting Case-Insensitive URLs83
5.11Replacing Text in Requested URLs84
5.12Rewriting Path Information to CGI Arguments85
5.13Denying Access to Unreferred Requests86
5.14Rewriting Based on the Query String87
5.15Redirecting All--or Part--of Your Server to SSL87
5.16Turning Directories into Hostnames88
5.17Redirecting All Requests to a Single Host89
5.18Turning Document Names into Arguments90
6.Security91
6.1Using System Account Information for Web Authentication92
6.2Setting Up Single-Use Passwords94
6.3Expiring Passwords95
6.4Limiting Upload Size97
6.5Restricting Images from Being Used Off-Site99
6.6Requiring Both Weak and Strong Authentication100
6.7Managing .htpasswd Files101
6.8Making Password Files for Digest Authentication103
6.9Relaxing Security in a Subdirectory104
6.10Lifting Restrictions Selectively106
6.11Authorizing Using File Ownership107
6.12Storing User Credentials in a MySQL Database108
6.13Accessing the Authenticated Username110
6.14Obtaining the Password Used to Authenticate110
6.15Preventing Brute-Force Password Attacks111
6.16Using Digest Versus Basic Authentication112
6.17Accessing Credentials Embedded in URLs113
6.18Securing WebDAV114
6.19Enabling WebDAV Without Making Files Writable by the Web User115
6.20Restricting Proxy Access to Certain URLs116
6.21Protecting Files with a Wrapper117
6.22Protecting All Files Except a Subset119
6.23Protecting Server Files from Malicious Scripts120
6.24Setting Correct File Permissions121
6.25Running a Minimal Module Set123
6.26Restricting Access to Files Outside Your Web Root125
6.27Limiting Methods by User126
6.28Restricting Range Requests127
7.SSL130
7.1Installing SSL130
7.2Generating SSL Certificates132
7.3Generating a Trusted CA135
7.4Serving a Portion of Your Site via SSL136
7.5Authenticating with Client Certificates138
8.Dynamic Content140
8.1Enabling a CGI Directory140
8.2Enabling CGI Scripts in Non-ScriptAliased Directories141
8.3Using Windows File Extensions to Launch CGI Programs142
8.4Using Extensions to Identify CGI Scripts143
8.5Testing That CGI Is Set Up Correctly144
8.6Reading Form Parameters147
8.7Invoking a CGI Program for Certain Content Types149
8.8Getting SSIs to Work151
8.9Displaying Last Modified Date152
8.10Including a Standard Header153
8.11Including the Output of a CGI Program154
8.12Running CGI Scripts as a Different User with suexec155
8.13Installing a mod_perl Handler from CPAN157
8.14Writing a mod_perl Handler158
8.15Enabling PHP Script Handling159
8.16Verifying PHP Installation160
9.Error Handling162
9.1Handling a Missing Host Field162
9.2Changing the Response Status for CGI Scripts163
9.3Customized Error Messages164
9.4Providing Error Documents in Multiple Languages165
9.5Redirecting Invalid URLs to Some Other Page166
9.6Making Internet Explorer Display Your Error Page167
9.7Notification on Error Conditions168
10.Proxies170
10.1Securing Your Proxy Server170
10.2Preventing Your Proxy Server from Being Used as an Open Mail Relay172
10.3Forwarding Requests to Another Server173
10.4Blocking Proxied Requests to Certain Places174
10.5Proxying mod_perl Content to Another Server174
10.6Configuring a Caching Proxy Server175
10.7Filtering Proxied Content176
10.8Requiring Authentication for a Proxied Server177
11.Performance178
11.1Determining How Much Memory You Need179
11.2Benchmarking Apache with ab180
11.3Tuning Keepalive Settings181
11.4Getting a Snapshot of Your Site's Activity183
11.5Avoiding DNS Lookups184
11.6Optimizing Symbolic Links185
11.7Minimizing the Performance Impact of .htaccess Files186
11.8Disabling Content Negotiation188
11.9Optimizing Process Creation190
11.10Tuning Thread Creation191
11.11Caching Frequently Viewed Files193
11.12Sharing Load Between Servers Using mod_proxy194
11.13Distributing Load Evenly Between Several Servers195
11.14Caching Directory Listings196
11.15Speeding Up Perl CGI Programs with mod_perl197
12.Miscellaneous Topics200
12.1Placing Directives Properly200
12.2Renaming .htaccess Files202
12.3Generating Directory/Folder Listings203
12.4Solving the "Trailing Slash" Problem205
12.5Setting the Content-Type According to Browser Capability206
12.6Handling Missing Host: Header Fields207
12.7Alternate Default Document207
12.8Setting Up a Default "Favicon"208
A.Using Regular Expressions in Apache211
B.Troubleshooting215
Index225
From the B&N Reads Blog

Customer Reviews