Chapter 15. The Apache Web Server

Table of Contents

15.1. Basics
15.2. Setting up the HTTP Server with YaST
15.3. Apache Modules
15.4. New Features of Apache 2
15.5. Threads
15.6. Installation
15.7. Configuration
15.8. Using Apache
15.9. Active Contents
15.10. Virtual Hosts
15.11. Security
15.12. Troubleshooting
15.13. For More Information

Abstract

With a share of more than sixty percent, Apache is the world's most widely-used web server (source: http://www.netcraft.com). For web applications, Apache is often combined with Linux, the database MySQL, and the programming languages PHP and Perl. This combination is commonly referred to as LAMP.

15.1. Basics

15.1.1. Web Server

A web server issues HTML pages requested by a client. These pages can be stored in a directory (passive or static pages) or generated in response to a query (active contents).

15.1.2. HTTP

The clients are usually web browsers, like Konqueror or Mozilla. Communication between the browser and the web server takes place by way of 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.

15.1.3. URLs

Clients use URLs, such as http://www.suse.com/index_us.html, to request pages from the server. A URL consists of:

  • A protocol. Frequently-used protocols:

    • http:// HTTP protocol

    • https:// Secure, encrypted version of HTTP

    • ftp:// file transfer protocol for uploading and downloading files

  • A domain, in this example, www.suse.com. The domain can be subdivided in two parts. The first part (www) points to a computer. The second part (suse.com) is the actual domain. Together, they are referred to as FQDN (fully qualified domain name).

  • A resource, in this example, index_us.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 Java server page, or some other resource.

The responsible Internet mechanism (such as the domain name system, DNS) conveys the query to the domain, directing it to one or several computers hosting the resource. Apache then delivers the actual resource (in this example, the page index_us.html) from its file directory. In this case, the file is located in the top level of the directory. However, resources can also be located in subdirectories, as in http://www.suse.com/us/business/services/support/index.html.

The file path is relative to the DocumentRoot, which can be changed in the configuration file. Section 15.7.2.1. “DocumentRoot” describes how this is done.

15.1.4. Automatic Display of a Default Page

If no default page is specified, Apache automatically appends one of the common names to the URL. The most frequently-used name for such pages is index.html. This function, together with the actual page names to be used by the server, can be configured as described in Section 15.7.2.7. “DirectoryIndex”. In our example, http://www.suse.com is sufficient to prompt the server to deliver the page http://www.suse.com/index_us.html.