Home > Store

Apache Web Server Administration and e-Commerce Handbook

Register your product to gain access to bonus material or receive a coupon.

Apache Web Server Administration and e-Commerce Handbook

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2001
  • Dimensions: K
  • Pages: 384
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-089873-2
  • ISBN-13: 978-0-13-089873-9

Build killer e-commerce sites with Apache!

  • Master configuration, management, and building e-commerce sites using Apache
  • Database integration, dynamic content delivery, secure transactions, and more
  • Covers all major platforms: UNIX, Linux, Windows—even Mac OS X
  • CD-ROM contains a complete Apache toolkit PLUS e-commerce templates
  • BONUS-Includes a PHP command reference!

Apache isn't just the #1 Web server—it's also the backbone for the world's leading e-commerce sites. In this comprehensive guide, Apache expert Scott Hawkins covers every aspect of configuring, administering, customizing, and troubleshooting Apache Server—and then demonstrates how to build powerful e-commerce applications based on PHP and MySQL, the leading open source scripting and database solutions!

Your complete Apache tutorial and resource!

  • Installation, configuration, and tuning
  • Secure transactions
  • Database integration
  • Proxy servers
  • Module creation
  • mod_perl API
  • Secured Socket Layer
  • CGI Configuration
  • Virtual hosting
  • MIME handling
  • Authentication and caching
  • Dynamic content delivery

You'll find advanced administration coverage not found in other Apache guides, PLUS detailed appendices cover Apache directives, key TCP/IP and name resolution concepts, HTTP header codes, the mod_perl API, and much more.

CD-ROM INCLUDED

A complete e-commerce toolkit! The accompanying CD-ROM contains Apache binaries and source code, MySQL, PHP4, mod_perl, and ready-to-run e-commerce applications built with these tools.

Sample Content

Downloadable Sample Chapter

Click here for a sample chapter for this book: 0130898732.pdf

Table of Contents

I. THE BASICS.

1. Basic Concepts.

Introduction. Configuration Files. Directives. Limiting the Scope of Directives. Modules. Dynamic Shared Objects. Handlers. MIME Types.

2. Installing Apache.

Introduction. Hardware Selection. System Preparation. Obtaining Apache. Compiling Apache. Installing Apache. Conclusion.

3. Configuring Apache.

Introduction. Modules. httpd.conf. Windows Only. Mac OS X Only.

4. Starting, Restarting, and Stopping.

Introduction. Starting Apache. Command Line Options. Restarting Apache. Stopping Apache. Troubleshooting.

II. ADVANCED ADMINISTRATION.

5. Hosting Multiple Sites.

Introduction. User Home Pages. IP Addresses and Ports. Virtual Hosting by Name. Configuring Name-Based Virtual Hosting on Apache. Virtual Hosting by IP. What to Configure When Virtual Hosting.

6. Proxy Servers and Caching.

Introduction. Why Bother? Configuring a Proxy Server. Caching. Configuring Browsers for Proxy.

7. Logs and Monitoring.

Introduction. Error Logs. Transfer Logs. Using mod_status. Using mod_info.

8. Security.

Introduction. Configuration Tips. Basic Authentication. User-Based Authentication. SSL.

9. Dynamic Content.

Introduction. Server-Side Includes. Include Listing. CGI. Controlling Resource Usage. FastCGI.

10. Performance Tuning.

Introduction. Windows Performance.

11. URL Rewriting.

Introduction. Essential mod_rewrite. Advanced mod_rewrite.

12. Module Construction.

Introduction. Installing mod_perl. The Apache API. Creating Handlers. Perl API Configuration Directives. Handler Directives. Performance Considerations.

III. E-COMMERCE.

13. Collecting Money.

Introduction. Credit Cards. Automated Clearing House. Public Key Encryption-based Commercial Products. SET.

14. Database Interaction.

Introduction. Databases. Delivering Database Content. PHP.

15. Sample e-commerce Site.

Introduction. Design. Database Design. The Site.

Appendix A: Core Directives.

Introduction. Core Directives.

Appendix B: Other Directives.

mod_access. mod_actions. mod_alias. mod_auth. mod_auth_anon. mod_auth_db. mod_auth_dbm. mod_browser. mod_cern_meta. mod_cgi. mod_digest. mod_dir. mod_env. mod_expires. mod_headers. mod_imap. mod_include. mod_info. mod_isapi. mod_log_agent. mod_log_common. mod_log_config. mod_log_referer. mod_mime. mod_mime_magic. mod_mmap_static. mod_negotiation. mod_proxy. mod_rewrite. mod_setenvif. mod_so. mod_speling. mod_status. mod_unique_id. mod_userdir. mod_usertrack.

Appendix C: TCP/IP Concepts.

Introduction. IP Addresses. Netmasks. IP Ports.

Appendix D: Name Resolution.

Introduction.

Appendix E: Network Troubleshooting.

Physical Connection Failures. Unix/Linux Software Diagnostics. Things To Look At When You Can't Ping. If You Can Ping Successfully.

Appendix F: Unix Concepts.

Configuration Files. Process. Daemons.

Appendix G: Windows NT.

Introduction.

Appendix H: HTTP Status Codes.

Introduction. xx: Informational Codes. xx: Success. xx: Redirection. xx: Client Error. xx: Server Error.

Appendix I: Regular Expressions.

Introduction.

Appendix J: mod_perl API.

Introduction.

Appendix K: PHP Statements.

Introduction. Apache Functions. Precision Mathematics Functions. Array Functions. GZlib. DBM. Date and Time Functions. dBase Functions. DBM Functions. Directory Functions. Dynamic Loading Functions. Encryption Functions. FilePro. File System Functions. FDF Functions. FTP Functions. Hash Functions. HTTP Functions. Informix. Mail Functions. Math Functions. MS-SQL. Miscellaneous Functions. mSQL Functions. MySQL Functions. Network Functions. NIS Functions. ODBC Functions. Oracle. Oracle. Perl Compatible Regular Expressions. POSIX Functions. Program Execution Functions. Recode. Sessions Functions. SNMP Functions. String Functions. Sybase Functions. URL Functions. Variable Functions.

Glossary.
Index.
About the CD.

Preface

Preface

Abstract

The intention of this book is to serve as a broad-based tutorial and reference for the Apache Web server. The book presumes some level of familiarity with computers, but no particular networking background. Though the main discussion focuses on e-commerce, the appendices cover a variety of peripheral information, such as name resolution, TCP/IP, and regular expressions, necessary for creating a functioning Web server. In addition, such topics as electronic payment and database interaction, which are particularly important for e-commerce sites, are covered from a Web administration perspective.

Apache

The Apache Web server is the crown jewel of the open source software movement. It costs nothing to obtain, performs better than the competition, and is thus more widely used than all other Web servers combined. At this writing, 61.5 percent of all Web sites worldwide are using the Apache server.

The propagation of open source software is tightly analogous to biological natural selection-the Linuxes and sendmails of the world eventually end up on the cover of Time magazine and are swallowed by the hype machine, while legions of DOS utilities slide slowly but inexorably to the /dev/null of history. Apache would not be popular if it didn't work well.

Apache has another virtue not quite so common in the open source world: it is simple enough that any reasonably competent computer user can master it. God knows I'm no huge fan of Microsoft, but if you gave me a choice between bringing my mother up to speed on either Linux or Windows 2000, I'd pick Windows quicker than you could say "Thomas Penfield Jackson." This is no slur on Linux, by the way; operating systems, particularly multiuser operating systems, are hugely complex. The only way to make them accessible to the average user is to dumb them down.

The collection of tasks delegated to Apache is thankfully not quite so vast. Those of you approaching Apache with little more than self-confidence and a sense of adventure will be relieved to know that the configuration and care of the server itself really isn't a particularly complex task. The trick, depending on your level of experience, will probably be to grasp the fundamental concepts of the operating system, learn the commands to make the machine do what you want it to do, and absorb the jargon. If you're already up on one or more of these topics, then you're really in for a pleasant surprise.

A Brief History

The Apache server is descended from the httpd server created by Rob McCool at the National Center for Supercomputing Applications (NCSA). In 1995, httpd was the most popular Web server in existence, but when McCool left NCSA in 1994, development of the program was stalled. A small group of Web administrators formed the core of what came to be known as the Apache Group. The members included

Brian Behlendorf
Roy T. Fielding
Rob Hartill
David Robinson
Cliff Skolnick
Randy Terbush
Robert S. Thau
Andrew Wilson

Together with contributions from Eric Hagberg, Frank Peters, and Nicolas Pioch, the Apache Group incorporated published bug fixes for httpd 1.3, added some new features, and released Apache 0.6.2 in April 1995.

Since then, the Apache group, as they came to be known, has been fine tuning and enhancing the base software. Software ports are now available for virtually all the major operating systems, though the Unix platform remains the forerunner.

The Apache Web server is the end result of an enormous coordinated effort by some extremely skilled programmers. You may ask yourself what motivated them to give Apache away rather than get in line for an IPO. I quote here from the apache.org Web site:

Apache exists to provide a robust and commercial-grade reference implementation of the HTTP protocol. It must remain a platform upon which individuals and institutions can build reliable systems, both for experimental purposes and for mission-critical purposes. We believe the tools of online publishing should be in the hands of everyone, and software companies should make their money providing value-added services such as specialized modules and support, amongst other things. We realize that it is often seen as an economic advantage for one company to "own" a market-in the software industry, that means to control tightly a particular conduit such that all others must pay. This is typically done by "owning" the protocols through which companies conduct business, at the expense of all those other companies. To the extent that the protocols of the World Wide Web remain "unowned" by a single company, the Web will remain a level playing field for companies large and small. Thus, "ownership" of the protocol must be prevented, and the existence of a robust reference implementation of the protocol, available absolutely for free to all companies, is a tremendously good thing.

Open Source Software

Apache is an open source product. Traditional shrink-wrapped software typically includes only the executable object code, not the human-readable source code from which it is compiled. Apache and the other open source products include with their distributions not only the executable object code, but also the source code files from which it was created.

From the end user's standpoint, this makes a lot of sense. For example, while I was writing this book, we had a problem in my office. A large commercial software package running on a large commercial operating system got into a state where it stopped responding to input and was, in fact, unkillable. We tried a stack trace and a few other things, but without the source code, there really wasn't a lot we could do. We finally dumped out everything we could and shipped it off to the software vendor for analysis. Presumably, they'll get back to us in a week or two.

As you might imagine, this was pretty frustrating. If we'd been using open source software, we'd probably already have come up with a workaround, if not an actual fix. We're not even real clear on what the problem is, and even if we did know, we have no means of recompiling the software to fix it. We are entirely at the mercy of our vendors.

Of course, this cuts both ways. Because no one is really getting paid for keeping up the open source version of Apache, there is no toll-free number you can dial at 2:00 a.m. if something goes wrong with your server and you can't figure out how to fix it. Support exists in the form of newsgroups and Web sites, but it occurs at the convenience of the supporter, not by demand of the "supportee."

Apache and the other open source software products benefit from their constant exposure to the developer community. Because there are more developers working on each open source project than even the wealthiest corporation could afford to hire, flawed source code is located and fixed more quickly.

I would also suggest that the initial quality of open source code tends to be higher than that which was commercially developed. Because open source developers are motivated by the simple love of programming, you tend to get the best of the best working on open source software. Contrast this with traditional software shops, where much of the day is spent in meetings, on the phone, and trading stocks.

Organization of This Book

This book is designed for use by Apache administrators of all skill levels. It assumes some familiarity with basic computer concepts, but no Web administration background is necessary. For those of you who are completely new to Apache, there is a lengthy introductory section, which spells out everything you need to know get started.

Having mastered the basic concepts, you will generally have one or two pet features (Virtual Hosting, for example) that you wish to implement as soon as possible. The chapters of this book are structured as independent essays on various topics. They can be read in any order you like.

Apache is increasingly refined by its exposure to the real world. New features are proposed and implemented every day, sometimes as enhancements of the core server functionality, more often as new or improved modules. For that reason, even expert users will, from time to time, need to expand their sphere of competence. Hopefully, this book has something to offer even to the experienced Apache administrator.

Finally, the appendices discuss a variety of networking and programming topics. Many of them aren't strictly Apache related, but because Apache needs a functioning network, your Web administration career will likely include a certain amount of general-purpose network administration and programming skills. The appendices aren't comprehensive, but I'd like to think they'll be handy.

Part I: The Basics

Part I covers the basic concepts and techniques of Apache administration. It walks you through the process of obtaining and installing an Apache server configured to meet your needs. If you haven't had previous exposure to Apache, you should read the first four chapters in sequence, particularly Chapter 1, "Basic Concepts." The information in Chapters 1 through 4, together with the appendices, is enough to get you going from a standing start.

Part II: Advanced Administration

Part II describes the more advanced features of Apache. Once you've got a handle on the basic concepts, you can feel free to jump around the chapters in Part II more or less at will. Each chapter is intended as a self-contained essay on whatever topic is suggested by the title.

Part III: e-Commerce

Part III discusses topics of particular interest to e-commerce sites, database connectivity, and the mechanisms of collecting money over the Web. The last chapter is a case study in creating the infrastructure of an e-commerce site.

Appendices

The appendices contain information which is either too raw to fit in with the rest of the book (for example, directive syntax) or more in the nature of background information (for example, Appendix G, "Unix Concepts"). Some are presented in the form of short tutorial essays; others are straightforward references.

How To Use This Book

Throughout the book you'll find example commands and configuration directives, always accompanied by at least some explanation and sometimes by example output. In general, I don't provide detailed syntax information for directives and system commands in the regular chapters. That sort of thing is found in the appendices, particularly in Appendix A, "Core Directives," and Appendix B, "Other Directives." Hopefully, you'll be able to glean from the context the general nature of any command with which you are unfamiliar.

The success or failure of any given Apache transaction depends on the internal server configuration, the content being transferred, the configuration of the underlying operating system, and the vagaries of the network support services. Therefore, it is impossible to say with absolute certainty that the examples presented herein will run on your particular machine. You have my solemn vow that I typed each and every one of them in and they worked for me.

In some cases, the starting configuration of a particular chapter was developed in an earlier chapter. For example, the Virtual hosts which are secured in Chapter 8 were created in Chapter 4. If the meaning of a particular configuration directive is unclear, consult the index and read about its ancestry in an earlier chapter.

Note that the example OS commands are frankly prejudiced toward the Unix environment in general and Linux in particular. This is no coincidence; my main test server as I was writing this book was a Linux machine, though some work was also done on Windows NT, Windows 95, and Mac OS X.

One Unix convention that I'm fond of, but that you don't generally see in Apache documentation, is the practice of specifying some environment variable to contain a lengthy directory path. Throughout this book you will sometimes see the Unix system variable

$APACHE

used to indicate the main directory in which Apache is installed. (This directory is known as ServerRoot in the configuration files.)

Finally, I tried to subdivide the discussion of the individual directives with some sort of meaningful headers. While most of the Apache directives have names that give a reasonably proficient computer user some idea of their function (for example, AddModule and Port), others refer to functionality that is specific to Apache and difficult to describe in twenty characters or less (for example, DocumentRoot). To make it easier for you to find what you're after just by flipping through the book, I'm using headers such as Where to Find HTML Files: DocumentRoot.

In general, I think this is a pretty good idea and I'm sticking by it. However, there was one unforeseen and rather lamentable side effect: From time to time, I found myself discussing a directive whose name was so self-explanatory that I could find no good way to rephrase it. I couldn't avoid putting in a header, because that's bad formatting and my editor would yell at me. In such cases, I was left with no alternative but to spell out an explanation of functionality that was already painfully obvious from the directive name, such as Specify an SSL Level: SSLLogLevel.

You have my apologies in advance.

If you have any questions, comments, corrections, or suggestions for improvement, please feel free to contact me at s_hawkins@mindspring.com.

Hydra

As an afterword, some of you may be wondering about the significance of the critter on the cover of the book. It's called a hydra, and it was painted by by a guy named Tom Post. The theme of the cover art on Prentice Hall's open source books is mythological beasties, and the hydra is actually a pretty good choice for Apache. Apache, you see, is typically found with many instances of itself running on the same machine, not unlike the multiple heads of the hydra. Get it? Credit to my editor, Miles Williams, for picking out a a mythological character with sharp teeth and not sticking me with a unicorn or a nymph or something like that.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020