Chapter 30. The Apache Web Server

Table of Contents

30.1. Basics
30.2. Setting Up the HTTP Server with YaST
30.3. Apache Modules
30.4. Threads
30.5. Installation
30.6. Configuration
30.7. Using Apache
30.8. Active Contents
30.9. Virtual Hosts
30.10. Security
30.11. Troubleshooting
30.12. For More Information


With a share of more than 60%, Apache is the world's most widely-used Web server (source: 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.

This chapter presents the Web server Apache. As well as explaining how to perform installation and configuration, it also describes some of the available modules. Variations for virtual hosts are also introduced.

30.1. Basics

This section provides a basic understanding of Web servers and the protocols they use. Also, most important features are introduced.

30.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).

30.1.2. HTTP

The clients are usually Web browsers, like Konqueror or Mozilla. Communication between the browser 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

30.1.3. URLs

Clients use URLs, such as, to request pages from the server. A URL consists of:


Frequently-used protocols:


The HTTP protocol


Secure, encrypted version of HTTP


file transfer protocol for downloading and uploading files


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


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 JavaServer page, or some other resource.

The responsible Internet mechanism, such as the domain name system, DNS, forwards 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

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

30.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 the server should use, can be configured as described in Section, “DirectoryIndex”. In this example, is sufficient to prompt the server to deliver the page

SUSE LINUX Administration Guide 9.3