Chapter 14. Apache HTTP Server
179
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 version 2.0 are divided into
three sections. The goal of this guide is to suggest what is hopefully the easiest route.
If your
httpd.conf
is a modified version of the default Red Hat version and you have saved a copy
of the original then you may find it easiest to invoke the
diff
command, as in the following example:
diff u httpd.conf.orig httpd.conf | less
This command will highlight the modifications you have made. If you do not have a copy of the
original file, extract it from an RPM package using the
rpm2cpio
and
cpio
commands, as in the
following example:
rpm2cpio apache 1.3.23 11.i386.rpm | cpio i make
Finally, it is useful to know that the Apache HTTP Server has a testing mode to check your configu
ration for errors. To use access it, type the following command:
apachectl configtest
14.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 it uses. This section requires a large number of changes compared with
the others and it is therefore recommended that you base this section on the Apache HTTP Server 2.0
configuration file and migrate your old settings into it.
14.2.1.1. Selecting Which Interfaces and Ports To Bind To
The
BindAddress
and
Port
directives no longer exist; their functionality is now provided by a more
flexible
Listen
directive.
If you had set
Port 80
in your 1.3 version configuration file, you should change it to
Listen 80
instead. If you had set
Port
to some value other than 80 then you must also append the port number
to the contents of your
ServerName
directive.
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:
Listen 123
ServerName www.example.com:123
For more on this topic, refer to the following documentation on the Apache Software Foundation's
website:
http://httpd.apache.org/docs 2.0/mod/mpm_common.html#listen
http://httpd.apache.org/docs 2.0/mod/core.html#servername
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved