install.xml revision 36461702119f178a2a47ca2fe3766a417e282402
8a77240a809197c92c0736c431b4b88947a7bac1Christian Maeder<?xml version='1.0' encoding='UTF-8' ?>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder<!-- $LastChangedRevision$ -->
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder<!--
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder Licensed to the Apache Software Foundation (ASF) under one or more
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu contributor license agreements. See the NOTICE file distributed with
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder this work for additional information regarding copyright ownership.
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder The ASF licenses this file to You under the Apache License, Version 2.0
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder (the "License"); you may not use this file except in compliance with
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder the License. You may obtain a copy of the License at
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder http://www.apache.org/licenses/LICENSE-2.0
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder Unless required by applicable law or agreed to in writing, software
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder distributed under the License is distributed on an "AS IS" BASIS,
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder See the License for the specific language governing permissions and
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder limitations under the License.
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder-->
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder<manualpage metafile="install.xml.meta">
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder <title>Compiling and Installing</title>
6820f0de92751e29d73d64db48e776591f529a76Christian Maeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<summary>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <p>This document covers compilation and installation of the Apache HTTP Server
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder on Unix and Unix-like systems only. For compiling and
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder installation on Windows, see <a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder href="platform/windows.html">Using Apache HTTP Server with Microsoft
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder Windows</a>. For other platforms, see the <a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder href="platform/">platform</a> documentation.</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <p>Apache httpd uses <code>libtool</code> and <code>autoconf</code>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder to create a build environment that looks like many other Open Source
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder projects.</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <p>If you are upgrading from one minor version to the next (for
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder example, 2.2.50 to 2.2.51), please skip down to the <a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder href="#upgrading">upgrading</a> section.</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder</summary>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
c56a356d3fcc5e123efa790aab320781d94df3c7Jonathan von Schroeder<seealso><a href="programs/configure.html">Configure the source tree</a></seealso>
c56a356d3fcc5e123efa790aab320781d94df3c7Jonathan von Schroeder<seealso><a href="invoking.html">Starting Apache httpd</a></seealso>
c56a356d3fcc5e123efa790aab320781d94df3c7Jonathan von Schroeder<seealso><a href="stopping.html">Stopping and Restarting</a></seealso>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<section id="overview"><title>Overview for the
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder impatient</title>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <table>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <columnspec><column width=".13"/><column width=".80"/></columnspec>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#download">Download</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <td><code>$ lynx http://httpd.apache.org/download.cgi</code>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#extract">Extract</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><code>$ gzip -d httpd-<em>NN</em>.tar.gz<br />
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder $ tar xvf httpd-<em>NN</em>.tar<br />
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder $ cd httpd-<em>NN</em></code></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#configure">Configure</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><code>$ /configure --prefix=<em>PREFIX</em></code>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#compile">Compile</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><code>$ make</code> </td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#install">Install</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><code>$ make install</code> </td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#customize">Customize</a></td>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <td><code>$ vi <em>PREFIX</em>/conf/httpd.conf</code> </td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><a href="#test">Test</a></td>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <td><code>$ <em>PREFIX</em>/bin/apachectl -k start</code>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder </td>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder </tr>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </table>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <p><em>NN</em> must be replaced with the current version
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder number, and <em>PREFIX</em> must be replaced with the
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder filesystem path under which the server should be installed. If
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder <em>PREFIX</em> is not specified, it defaults to
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder <code>/usr/local/apache2</code>.</p>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <p>Each section of the compilation and installation process is
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder described in more detail below, beginning with the requirements
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder for compiling and installing Apache httpd.</p>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder</section>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<section id="requirements"><title>Requirements</title>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
c56a356d3fcc5e123efa790aab320781d94df3c7Jonathan von Schroeder <p>The following requirements exist for building Apache httpd:</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <dl>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <dt>Disk Space</dt>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <dd>Make sure you have at least 50 MB of temporary free disk
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder space available. After installation the server occupies
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder approximately 10 MB of disk space. The actual disk space
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder requirements will vary considerably based on your chosen
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder configuration options, any third-party modules, and, of course,
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder the size of the web site or sites that you have on the server.</dd>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <dt>ANSI-C Compiler and Build System</dt>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <dd>Make sure you have an ANSI-C compiler installed. The <a
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder href="http://gcc.gnu.org/">GNU C
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder compiler (GCC)</a> from the <a
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder href="http://www.gnu.org/">Free Software Foundation (FSF)</a>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder is recommended. If you don't have GCC
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder then at least make sure your vendor's compiler is ANSI
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder compliant. In addition, your <code>PATH</code> must contain
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder basic build tools such as <code>make</code>.</dd>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <dt>Accurate time keeping</dt>
80d2ec8f37d5ddec13c14b17b1bab01e9c94630aChristian Maeder <dd>Elements of the HTTP protocol are expressed as the time of
a669e4685b32ff5ca1bca785eacc5e30a545b010Christian Maeder day. So, it's time to investigate setting some time
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder synchronization facility on your system. Usually the
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <code>ntpdate</code> or <code>xntpd</code> programs are used for
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder this purpose which are based on the Network Time Protocol (NTP).
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder See the <a href="http://www.ntp.org">NTP
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder homepage</a> for more details about NTP software and public
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder time servers.</dd>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <dt><a href="http://www.perl.org/">Perl 5</a>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder [OPTIONAL]</dt>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <dd>For some of the support scripts like <program>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder apxs</program> or <program>dbmmanage</program> (which are
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder written in Perl) the Perl 5 interpreter is required (versions
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder 5.003 or newer are sufficient). If you have multiple Perl
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder interpreters (for example, a systemwide install of Perl 4, and
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder your own install of Perl 5), you are advised to use the
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <code>--with-perl</code> option (see below) to make sure the
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder correct one is used by <program>configure</program>.
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder If no Perl 5 interpreter is found by the
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <program>configure</program> script, you will not be able to use
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder the affected support scripts. Of course, you will still be able to
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder build and use Apache httpd.</dd>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder </dl>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder</section>
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<section id="download"><title>Download</title>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder <p>The Apache HTTP Server can be downloaded from the <a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder href="http://httpd.apache.org/download.cgi">Apache HTTP Server
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder download site</a>, which lists several mirrors. Most users of
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder Apache on unix-like systems will be better off downloading and
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder compiling a source version. The build process (described below) is
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder easy, and it allows you to customize your server to suit your needs.
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder In addition, binary releases are often not up to date with the latest
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder source releases. If you do download a binary, follow the instructions
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder in the <code>INSTALL.bindist</code> file inside the distribution.</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder <p>After downloading, it is important to verify that you have a
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder complete and unmodified version of the Apache HTTP Server. This
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder can be accomplished by testing the downloaded tarball against the
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder PGP signature. Details on how to do this are available on the <a
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder href="http://httpd.apache.org/download.cgi#verify">download
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder page</a> and an extended example is available describing the <a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder href="http://httpd.apache.org/dev/verification.html">use of
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder PGP</a>.</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder</section>
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder<section id="extract"><title>Extract</title>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder <p>Extracting the source from the Apache HTTP Server tarball is a
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder simple matter of uncompressing, and then untarring:</p>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
d71447e45047d07006b4c20409fbd8ea287df01fJonathan von Schroeder<example>
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder$ gzip -d httpd-<em>NN</em>.tar.gz<br />
$ tar xvf httpd-<em>NN</em>.tar
</example>
<p>This will create a new directory under the current directory
containing the source code for the distribution. You should
<code>cd</code> into that directory before proceeding with
compiling the server.</p>
</section>
<section id="configure"><title>Configuring the source tree</title>
<p>The next step is to configure the Apache source tree for your
particular platform and personal requirements. This is done using
the script <program>configure</program> included in
the root directory of the distribution. (Developers downloading
an unreleased version of the Apache source tree will need to have
<code>autoconf</code> and <code>libtool</code> installed and will
need to run <code>buildconf</code> before proceeding with the next
steps. This is not necessary for official releases.)</p>
<p>To configure the source tree using all the default options,
simply type <code>/configure</code>. To change the default
options, <program>configure</program> accepts a variety of variables
and command line options.</p>
<p>The most important option is the location <code>--prefix</code>
where Apache is to be installed later, because Apache has to be
configured for this location to work correctly. More fine-tuned
control of the location of files is possible with additional <a
href="programs/configure.html#installationdirectories">configure
options</a>.</p>
<p>Also at this point, you can specify which <a
href="programs/configure.html#optionalfeatures">features</a> you
want included in Apache by enabling and disabling <a
href="mod/">modules</a>. Apache comes with a wide range of modules
included by default. They will be compiled as
<a href="dso.html">shared objects (DSOs)</a> which can be loaded
or unloaded at runtime.
You can also choose to compile modules statically by using the option
<code>--enable-<var>module</var>=static</code>.</p>
<p>Additional modules are enabled using the
<code>--enable-<var>module</var></code> option, where
<var>module</var> is the name of the module with the
<code>mod_</code> string removed and with any underscore converted
to a dash. Similarly, you can disable modules with the
<code>--disable-<var>module</var></code> option. Be careful when
using these options, since <program>configure</program> cannot warn you
if the module you specify does not exist; it will simply ignore the
option.</p>
<p>In addition, it is sometimes necessary to provide the
<program>configure</program> script with extra information about the
location of your compiler, libraries, or header files. This is
done by passing either environment variables or command line
options to <program>configure</program>. For more information, see the
<program>configure</program> manual page. Or invoke
<program>configure</program> using the <code>--help</code> option.</p>
<p>For a short impression of what possibilities you have, here
is a typical example which compiles Apache for the installation
tree <code>/sw/pkg/apache</code> with a particular compiler and flags
plus the two additional modules <module>mod_ldap</module> and
<module>mod_lua</module>:</p>
<example>
$ CC="pgcc" CFLAGS="-O2" \<br />
/configure --prefix=/sw/pkg/apache \<br />
--enable-ldap=shared \<br />
--enable-lua=shared
</example>
<p>When <program>configure</program> is run it will take several minutes to
test for the availability of features on your system and build
Makefiles which will later be used to compile the server.</p>
<p>Details on all the different <program>configure</program> options are
available on the <program>configure</program> manual page.</p>
</section>
<section id="compile"><title>Build</title>
<p>Now you can build the various parts which form the Apache
package by simply running the command:</p>
<example>$ make</example>
<p>Please be patient here, since a base configuration takes
several minutes to compile and the time will vary widely
depending on your hardware and the number of modules that you
have enabled.</p>
</section>
<section id="install"><title>Install</title>
<p>Now it's time to install the package under the configured
installation <em>PREFIX</em> (see <code>--prefix</code> option
above) by running:</p>
<example>$ make install</example>
<p>This step will typically require root privileges, since
<em>PREFIX</em> is usually a directory with restricted write
permissions.</p>
<p>If you are upgrading, the installation will not overwrite
your configuration files or documents.</p>
</section>
<section id="customize"><title>Customize</title>
<p>Next, you can customize your Apache HTTP server by editing
the <a href="configuring.html">configuration files</a> under
<code><em>PREFIX</em>/conf/</code>.</p>
<example>$ vi <em>PREFIX</em>/conf/httpd.conf</example>
<p>Have a look at the Apache manual under
<code><em>PREFIX</em>/docs/manual/</code> or consult <a
href="http://httpd.apache.org/docs/&httpd.docs;/"
>http://httpd.apache.org/docs/&httpd.docs;/</a> for the most recent
version of this manual and a complete reference of available <a
href="mod/directives.html">configuration directives</a>.</p>
</section>
<section id="test"><title>Test</title>
<p>Now you can <a href="invoking.html">start</a> your Apache
HTTP server by immediately running:</p>
<example>$ <em>PREFIX</em>/bin/apachectl -k start</example>
<p>You should then be able to request your first document
via the URL <code>http://localhost/</code>. The web page you see is located
under the <directive module="core">DocumentRoot</directive>,
which will usually be <code><em>PREFIX</em>/htdocs/</code>.
Then <a href="stopping.html">stop</a> the server again by
running:</p>
<example>$ <em>PREFIX</em>/bin/apachectl -k stop</example>
</section>
<section id="upgrading"><title>Upgrading</title>
<p>The first step in upgrading is to read the release announcement
and the file <code>CHANGES</code> in the source distribution to
find any changes that may affect your site. When changing between
major releases (for example, from 2.0 to 2.2 or from 2.2 to 2.3),
there will likely be major differences in the compile-time and
run-time configuration that will require manual adjustments. All
modules will also need to be upgraded to accomodate changes in the
module API.</p>
<p>Upgrading from one minor version to the next (for example, from
2.2.55 to 2.2.57) is easier. The <code>make install</code>
process will not overwrite any of your existing documents, log
files, or configuration files. In addition, the developers make
every effort to avoid incompatible changes in the
<program>configure</program> options, run-time configuration, or the
module API between minor versions. In most cases you should be able to
use an identical <program>configure</program> command line, an identical
configuration file, and all of your modules should continue to
work.</p>
<p>To upgrade across minor versions, start by finding the file
<code>config.nice</code> in the <code>build</code> directory of
your installed server or at the root of the source tree for your
old install. This will contain the exact
<program>configure</program> command line that you used to
configure the source tree. Then to upgrade from one version to
the next, you need only copy the <code>config.nice</code> file to
the source tree of the new version, edit it to make any desired
changes, and then run:</p>
<example>
$ /config.nice<br />
$ make<br />
$ make install<br />
$ <em>PREFIX</em>/bin/apachectl -k graceful-stop<br />
$ <em>PREFIX</em>/bin/apachectl -k start<br />
</example>
<note type="warning">You should always test any new version in your
environment before putting it into production. For example, you
can install and run the new version along side the old one by
using a different <code>--prefix</code> and a
different port (by adjusting the <directive
module="mpm_common">Listen</directive> directive) to test for any
incompatibilities before doing the final upgrade.</note>
<p>You can pass additional arguments to <code>config.nice</code>,
which will be appended to your original <program>configure</program>
options:</p>
<example>
$ /config.nice --prefix=/home/test/apache --with-port=90
</example>
</section>
<section id="thirdp"><title>Third-party packages</title>
<p>A large number of third parties provide their own packaged
distributions of the Apache HTTP Server for installation on
particular platforms. This includes the various Linux distributions,
various third-party Windows packages, Mac OS X, Solaris, and many
more.</p>
<p>Our software license not only permits, but encourages, this kind
of redistribution. However, it does result in a situation where the
configuration layout and defaults on your installation of the server
may differ from what is stated in the documentation. While
unfortunate, this situation is not likely to change any time
soon.</p>
<p>A <a
href="http://wiki.apache.org/httpd/DistrosDefaultLayout">description
of these third-party distrubutions</a> is maintained in the HTTP
Server wiki, and should reflect the current state of these
third-party distributions. However, you will need to familiarize
yourself with your particular platform's package management and
installation procedures.</p>
</section>
</manualpage>