Chapter 46. The Apache Web Server

Table of Contents

46.1. Preface and Terminology
46.2. Installation
46.3. Configuration
46.4. Virtual Hosts
46.5. Apache Modules
46.6. Security
46.7. Troubleshooting
46.8. For More Information

Abstract

With a share of more than 60%, Apache is the world's most widely-used Web server according to http://www.netcraft.com. For Web applications, Apache is often used on Linux, with the database MySQL, and the programming languages PHP and Perl. This combination is commonly referred to as LAMP.

This chapter introduces the Web and application server software Apache in version 2.x. Installation and configuration of Apache are explained here, along with the usage of some of the available modules.

46.1. Preface and Terminology

This section provides definitions of frequently used terms, both Web-related and particular to Apache.

[Important]Terminology

In this document, the term Apache refers to Apache in version 2.x. For documentation on Apache 1.x, see http://httpd.apache.org/docs/.

46.1.1. Web Server

A Web server delivers Web pages requested by a client. The client can be a Web browser, such as Konqueror, or any other device that can connect to the World Wide Web. These pages can be stored as a whole on disk (static pages) or generated in response to a query (dynamic pages) of an external entity, such as a database or a Web service.

46.1.2. HTTP

Communication between the client and the Web server takes place using the hypertext transfer protocol (HTTP). The current version, HTTP 1.1, is documented in RFC 2068 and in the update RFC 2616. These RFCs are available at http://www.w3.org.

46.1.3. URLs

URL stands for universal resource locator. Clients use URLs, such as http://www.example.com/index.html, to request pages from the server. A URL consists of:

Protocol

Frequently-used protocols:

http://

The HTTP protocol

https://

Secure, encrypted version of HTTP

ftp://

File transfer protocol for downloading and uploading files

Domain

In this example, the domain is www.example.com. The domain is the name that corresponds to an IP address. Thus, www.example.com maps uniquely to an IP address like 123.456.789.1. In turn, the number uniquely identifies the computer running a Web server. The mapping of a domain name to an IP address is commonly referred to as name resolution. The domain can be subdivided into several parts, here: www, example, and com. The last part of the domain name is the top level domain (TLD). In this example, com is the TLD. TLD represents the top level of the name resolution process. TLDs can be generic (gTLDs, such as com, org, and net) or country-specific (ccTLDs, such as de for Germany). All parts of a domain together are referred to as the fully qualified domain name (FQDN).

Resource

In this example, the resource is index.html. This part specifies the full path to the resource. The resource can be a file, as in this example. However, it can also be a CGI script, a JavaServer page, or some other resource.

The responsible Internet mechanism, such as the domain name system (DNS) forwards the query to the domain www.example.com to one or several computers holding the resource. Apache then delivers the actual resource, in this example, the page index.html, to the client. In this case, the file is located in the top level directory. However, resources can also be located in subdirectories, as in http://www.example.com/linux/novell/suse.

46.1.4. Directive

For configuring Apache, the term directive is often used as a synoynm for “configuration option.” Directive is the technical term pertaining to the Apache Web server software.