| |
| |
About the Author | |
| |
| |
About the Technical Reviewer | |
| |
| |
Acknowledgments | |
| |
| |
| |
Introduction to Apache | |
| |
| |
How does a web server work? | |
| |
| |
The Hypertext Transfer Protocol | |
| |
| |
A brief history of Apache | |
| |
| |
Why should I choose Apache over Internet Information Server? | |
| |
| |
A proven track record of security | |
| |
| |
Performance | |
| |
| |
Flexibility | |
| |
| |
The bottom line: Cost | |
| |
| |
What to know before installing Apache | |
| |
| |
How popular is the site? How does this translate into hits per month, day, and hour? | |
| |
| |
What scripting environments (Perl, PHP, ASP, JSP) are currently being used for the website? | |
| |
| |
How large is the website, and how long do I want to keep server logs for? | |
| |
| |
Who do I want to have access to the web server? | |
| |
| |
Which operating system should I use? | |
| |
| |
Linux | |
| |
| |
Pros | |
| |
| |
Cons | |
| |
| |
Windows | |
| |
| |
Pros | |
| |
| |
Cons | |
| |
| |
The bottom line | |
| |
| |
Where do I get Apache? | |
| |
| |
Should I install from source or binary? | |
| |
| |
Which version of Apache should I use? | |
| |
| |
Summing it up | |
| |
| |
| |
Installing Apache | |
| |
| |
Before you begin | |
| |
| |
Requirements | |
| |
| |
Windows users | |
| |
| |
Set up your firewall | |
| |
| |
Important note for Mac OS X users | |
| |
| |
Source or binary? | |
| |
| |
The source, Luke | |
| |
| |
Taking the path less traveled | |
| |
| |
The benefit of binary | |
| |
| |
A note for Windows users | |
| |
| |
Choosing the right package for your operating system | |
| |
| |
How to configure Apache by editing the configuration files | |
| |
| |
Where to find Apache's configuration files | |
| |
| |
Where do the files for the website go? | |
| |
| |
Summing it up | |
| |
| |
| |
Basic Directives | |
| |
| |
Server-level configuration | |
| |
| |
httpd.conf | |
| |
| |
access.conf and srm.conf | |
| |
| |
access.conf | |
| |
| |
srm.conf | |
| |
| |
mime.types | |
| |
| |
Directory-level configuration | |
| |
| |
Server types | |
| |
| |
Configuring a domain | |
| |
| |
Basic configuration | |
| |
| |
Directory options | |
| |
| |
Configuring user directories | |
| |
| |
Loading the mod_userdir module | |
| |
| |
Configuring and mod_userdir module | |
| |
| |
Configuring the user directories | |
| |
| |
Changing the default index file | |
| |
| |
Rewriting URLs | |
| |
| |
Rewriting URLs at the server level | |
| |
| |
Example | |
| |
| |
Rewriting URLs at the directory level | |
| |
| |
An alternative to mod_rewrite | |
| |
| |
Redirecting URLs to an external web server | |
| |
| |
Creating custom error messages | |
| |
| |
Example: useit.com | |
| |
| |
ErrorDocument syntax | |
| |
| |
Redirecting to external error documents | |
| |
| |
Authenticating users through Apache | |
| |
| |
Basic configuration | |
| |
| |
Configuring access based on IP address | |
| |
| |
Example: Restricting access to an intranet directory | |
| |
| |
Adding new file types | |
| |
| |
Configuring mime.types | |
| |
| |
Including external configuration files | |
| |
| |
Applying changes | |
| |
| |
Summing it up | |
| |
| |
| |
Virtual Hosts | |
| |
| |
DNS configuration | |
| |
| |
To configure BIND (Linux, Windows, and Mac OS X) | |
| |
| |
Sample BIND configuration | |
| |
| |
To configure DNS on Windows 2000/XP | |
| |
| |
Apache configuration | |
| |
| |
Name-based vs. IP-based virtual hosting | |
| |
| |
Configuring Apache | |
| |
| |
Sample Apache configuration | |
| |
| |
[left angle bracket]VirtualHost[greater angle bracket] | |
| |
| |
ServerAdmin | |
| |
| |
DocumentRoot | |
| |
| |
ServerName and ServerAlias | |
| |
| |
ErrorLog and CustomLog | |
| |
| |
ScriptAlias | |
| |
| |
Using separate configuration files | |
| |
| |
Summing it up | |
| |
| |
| |
Modules | |
| |
| |
What modules are installed by default? | |
| |
| |
mod_env.c | |
| |
| |
mod_log_config.c | |
| |
| |
mod_mime.c | |
| |
| |
mod_negotiation.c | |
| |
| |
mod_include.c | |
| |
| |
mod_autoindex.c | |
| |
| |
mod_dir.c | |
| |
| |
mod_isapi.c | |
| |
| |
mod_cgi.c | |
| |
| |
mod_asis.c | |
| |
| |
mod_imap.c | |
| |
| |
mod_actions.c | |
| |
| |
mod_userdir.c | |
| |
| |
mod_alias.c | |
| |
| |
mod_access.c | |
| |
| |
mod_auth.c | |
| |
| |
mod_so.c | |
| |
| |
mod_setenvif.c | |
| |
| |
Where do I find modules? | |
| |
| |
How do I install modules? | |
| |
| |
AddModule | |
| |
| |
LoadModule | |
| |
| |
AddType | |
| |
| |
Configuring the module | |
| |
| |
Recommended modules | |
| |
| |
mod_rewrite and mod_alias | |
| |
| |
mod_throttle | |
| |
| |
Summing it up | |
| |
| |
| |
Scripting Languages & Server Side Includes | |
| |
| |
Configuring Apache for Perl | |
| |
| |
Configuring Apache for PHP | |
| |
| |
Running PHP on a Windows server | |
| |
| |
Installing PHP as an Apache module under Windows | |
| |
| |
Server Side Includes | |
| |
| |
Configuring Server Side Includes in Apache | |
| |
| |
SSI syntax | |
| |
| |
How to break up your files | |
| |
| |
Additional SSI commands | |
| |
| |
Summing it up | |
| |
| |
| |
Secure Web (Secure Sockets Layer) | |
| |
| |
What is Secure Sockets Layer? | |
| |
| |
A note before we go any further | |
| |
| |
Where do I get SSL? | |
| |
| |
Certificates | |
| |
| |
Install a certificate from a Certificate Authority | |
| |
| |
Create a new certificate | |
| |
| |
Become your own Certificate Authority | |
| |
| |
Get started | |
| |
| |
Generate the CA private key | |
| |
| |
Create a public CA certificate | |
| |
| |
Sign your own certificates | |
| |
| |
The sign.sh script | |
| |
| |
Apache configuration | |
| |
| |
Create a separate configuration file | |
| |
| |
Load the SSL module | |
| |
| |
Configure the SSL server | |
| |
| |
Using IfDefine and IfModule sections | |
| |
| |
Configure the global options | |
| |
| |
Configure the secure server | |
| |
| |
Secure Sockets Layer or Transport Layer Security? | |
| |
| |
Installing a Certificate Authority public key | |
| |
| |
Summing it up | |
| |
| |
| |
Log Files | |
| |
| |
Before you begin | |
| |
| |
Error.log | |
| |
| |
Configuring the error log | |
| |
| |
access.log | |
| |
| |
Formatting the access log | |
| |
| |
Combined logs | |
| |
| |
Multiple log files | |
| |
| |
Conditional log files | |
| |
| |
Reading the log | |
| |
| |
Where can I find Apache's log files? | |
| |
| |
Configuring Apache logs | |
| |
| |
Log files for virtual hosts | |
| |
| |
split-logfile | |
| |
| |
Rotating log files | |
| |
| |
How to configure log rotation | |
| |
| |
Piped logs | |
| |
| |
Reading archived log files | |
| |
| |
What do I do with all these access logs? | |
| |
| |
Using log-analysis programs | |
| |
| |
Analog | |
| |
| |
Webalizer | |
| |
| |
WebTrends | |
| |
| |
Creating custom scripts | |
| |
| |
Troubleshooting with Apache | |
| |
| |
Tracking down 404 errors and learning why they occur | |
| |
| |
Summing it up | |
| |
| |
| |
Sample Apache Configurations | |
| |
| |
Basic Apache configuration (with PHP) | |
| |
| |
Sample httpd.conf configuration file | |
| |
| |
Slashdotted! | |
| |
| |
Sample httpd.conf configuration file | |
| |
| |
Protected intranet directory | |
| |
| |
Sample httpd.conf file | |
| |
| |
Running virtual hosts | |
| |
| |
Sample httpd.conf configuration file | |
| |
| |
Compressed HTTP sessions | |
| |
| |
Sample httpd.conf configuration file | |
| |
| |
Summing it up | |
| |
| |
| |
Resources | |
| |
| |
Afterword: You Are an Apache Guru | |
| |
| |
Index | |