14.2. Configuring and Building Apache
If your Linux distribution does not
currently have Apache, the easiest way to get it is from one of the
many Apache mirror sites. A list can be found at the main Apache
Software Foundation site, http://www.apache.org. At present, there are
two branches of the Apache HTTPD version tree, 1.3 and 2.0. The new
version tree, v2.0 offers new features and is being actively
developed, but is more likely to be susceptible to bugs and
vulnerabilities. In this chapter, we will be using the most recent
version of the 1.3 branch because of its proven reliability and
stability. Many of the configuration options, however, are similar in
both versions.
14.2.1. Getting and Compiling the Software
You have the option of obtaining
Apache in either source format or package format. If you are
installing from package, you will not have the same amount of initial
configuration flexibility as you would building from source. Packages
generally come with the most common options pre-built into the
binaries. If you are looking for specific features or options or if
you want to build a very minimal version of the server, you should
consider building from source.Building Apache from source is similar to building other Linux source
packages and follows the "configure-make-make
install" path. Apache has many options that need to
be set at source configuration time. Among these is the ability to
select the modules which you would like to build or have disabled.
Modules are a great way to add or remove functionality to your web
server and cover a wide range of functionsfrom performance to
authentication and security. Table 14-1 shows a
sample list taken from the Apache documentation of a number of the
available modules.
configure script as follows. To enable a module, use:
vlager# ./configure -enable-module=module_nameTo disable a default module, you can use the following command:
vlager# ./configure -disable-module=module_nameIf you choose to enable or disable any of the default modules, make
sure you understand exactly what that modules does. Enabling or
disabling certain modules can adversely affect performance or
security. More information about the specific modules can be found on
the Apache web site.
The next step after configuration is to
compile the entire package. Like many other Linux programs, this is
accomplished by the make command. After you have
compiled, make install will install Apache in
the directory you specified via the -prefix=
option at configuration time.