10.2. Migrating Apache HTTP Server 1.3 Configuration Files
This section details migrating an Apache HTTP Server 1.3 configuration file to be utilized by Apache HTTP Server 2.0.
If upgrading to Red Hat Enterprise Linux 4.5.0 from Red Hat Enterprise Linux 2.1, note that the new stock configuration file for the Apache HTTP Server 2.0 package is installed as
/etc/httpd/conf/httpd.conf.rpmnewand the original version 1.3
httpd.confis left untouched. It is entirely up to you whether to use the new configuration file and migrate the old settings to it, or use the existing file as a base and modify it to suit; however, some parts of the file have changed more than others and a mixed approach is generally the best. The stock configuration files for both version 1.3 and 2.0 are divided into three sections.
/etc/httpd/conf/httpd.conffile is a modified version of the newly installed default and a saved a copy of the original configuration file is available, it may be easiest to invoke the
diffcommand, as in the following example (logged in as root):
diff -u httpd.conf.orig httpd.conf | less
This command highlights any modifications made. If a copy of the original file is not available, extract it from an RPM package using the
cpiocommands, as in the following example:
rpm2cpio apache-<version-number>.i386.rpm | cpio -i --make
In the above command, replace <version-number> with the version number for the
Finally, it is useful to know that the Apache HTTP Server has a testing mode to check for configuration errors. To use access it, type the following command:
10.2.1. Global Environment Configuration
The global environment section of the configuration file contains directives which affect the overall operation of the Apache HTTP Server, such as the number of concurrent requests it can handle and the locations of the various files. This section requires a large number of changes and should be based on the Apache HTTP Server 2.0 configuration file, while migrating the old settings into it.
10.2.1.1. Interface and Port Binding
Portdirectives no longer exist; their functionality is now provided by a more flexible
Port 80was set in the 1.3 version configuration file, change it to
Listen 80in the 2.0 configuration file. If
Portwas set to some value other than 80, then append the port number to the contents of the
For example, the following is a sample Apache HTTP Server 1.3 directive:
Port 123 ServerName www.example.com
To migrate this setting to Apache HTTP Server 2.0, use the following structure:
Listen123 ServerName www.example.com:
For more on this topic, refer to the following documentation on the Apache Software Foundation's website:
10.2.1.2. Server-Pool Size Regulation
When the Apache HTTP Server accepts requests, it dispatches child processes or threads to handle them. This group of child processes or threads is known as a server-pool. Under Apache HTTP Server 2.0, the responsibility for creating and maintaining these server-pools has been abstracted to a group of modules called Multi-Processing Modules (MPMs). Unlike other modules, only one module from the MPM group can be loaded by the Apache HTTP Server. There are three MPM modules that ship with 2.0:
perchild. Currently only the
workerMPMs are available, although the
perchildMPM may be available at a later date.
The original Apache HTTP Server 1.3 behavior has been moved into the
preforkMPM accepts the same directives as Apache HTTP Server 1.3, so the following directives may be migrated directly:
workerMPM implements a multi-process, multi-threaded server providing greater scalability. When using this MPM, requests are handled by threads, conserving system resources and allowing large numbers of requests to be served efficiently. Although some of the directives accepted by the
workerMPM are the same as those accepted by the
preforkMPM, the values for those directives should not be transfered directly from an Apache HTTP Server 1.3 installation. It is best to instead use the default values as a guide, then experiment to determine what values work best.
To use the
workerMPM, create the file
/etc/sysconfig/httpdand add the following directive:
For more on the topic of MPMs, refer to the following documentation on the Apache Software Foundation's website:
10.2.1.3. Dynamic Shared Object (DSO) Support
There are many changes required here, and it is highly recommended that anyone trying to modify an Apache HTTP Server 1.3 configuration to suit version 2.0 (as opposed to migrating the changes into the version 2.0 configuration) copy this section from the stock Apache HTTP Server 2.0 configuration file.
Those who do not want to copy the section from the stock Apache HTTP Server 2.0 configuration should note the following:
ClearModuleListdirectives no longer exist. These directives where used to ensure that modules could be enabled in the correct order. The Apache HTTP Server 2.0 API allows modules to specify their ordering, eliminating the need for these two directives.
- The order of the
LoadModulelines are no longer relevant in most cases.
- Many modules have been added, removed, renamed, split up, or incorporated into others.
LoadModulelines for modules packaged in their own RPMs (
mod_perl, and the like) are no longer necessary as they can be found in their relevant files within the
- The various
HAVE_XXXdefinitions are no longer defined.
If modifying the original file, note that it is of paramount importance that the
httpd.confcontains the following directive:
Omission of this directive results in the failure of all modules packaged in their own RPMs (such as
10.2.1.4. Other Global Environment Changes
The following directives have been removed from Apache HTTP Server 2.0's configuration:
ServerType— The Apache HTTP Server can only be run as
ServerType standalonemaking this directive irrelevant.
ResourceConfig— These directives have been removed as they mirror the functionality of the
Includedirective. If the
ResourceConfigdirectives are set, replace them with
Includedirectives.To ensure that the files are read in the order implied by the older directives, the
Includedirectives should be placed at the end of the
httpd.conf, with the one corresponding to
ResourceConfigpreceding the one corresponding to
AccessConfig. If using the default values, include them explicitly as