install.html revision 65dfb805c10b65ed25039d258bba03c1a56d7aee
89a126810703c666309310d0f3189e9834d70b5bTimo Sirainen<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen <meta name="generator" content="HTML Tidy, see www.w3.org" />
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen <title>Compiling and Installing Apache</title>
463e82bdf0e990f4f2252d2b53ea23a5abe5883cTimo Sirainen <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen <!--#include virtual="header.html" -->
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen <h1 align="CENTER">Compiling and Installing</h1>
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen <p>This document covers compilation and installation of Apache
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen on Unix and Unix-like systems only. For compiling and
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen installation on Windows, see <a
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen href="platform/windows.html">Using Apache with Microsoft
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen href="platform/">platform</a> documentation.</p>
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen <p>Apache 2.0's configuration and installation environment has
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen changed completely from Apache 1.3. Apache 1.3 used a custom
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen set of scripts to achieve easy installation. Apache 2.0 now
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen uses libtool and autoconf to create an environment that looks
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen like many other Open Source projects.</p>
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen <li><a href="#overview">Overview for the impatient</a></li>
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen <li><a href="#requirements">Requirements</a></li>
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen <a href="#configure">Configuring the source tree</a>
7bd3f5614e0dd2324dd1015f084de72c0b069a1aTimo Sirainen <li><a href="#environment">Environment Variables</a></li>
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen <li><a href="#output">autoconf Output Options</a></li>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <h3><a id="overview" name="overview">Overview for the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen http://www.apache.org/dist/httpd/httpd-2_0_<em>NN</em>.tar.gz</code>
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen <td><code>$ gzip -d httpd-2_0_<em>NN</em>.tar.gz<br />
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen $ tar xvf httpd-2_0_<em>NN</em>.tar</code> </td>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <td><code>$ /configure --prefix=<em>PREFIX</em></code>
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen <td><code>$ vi <em>PREFIX</em>/conf/httpd.conf</code> </td>
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen <td><code>$ <em>PREFIX</em>/bin/apachectl start</code>
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen <p><em>NN</em> must be replaced with the current minor version
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen number, and <em>PREFIX</em> must be replaced with the
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen filesystem path under which the server should be installed. If
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen <em>PREFIX</em> is not specified, it defaults to
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen <p>Each section of the compilation and installation process is
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen described in more detail below, beginning with the requirements
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen for compiling and installing Apache HTTPD.</p>
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen <p>The following requirements exist for building Apache:</p>
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen Make sure you have at least 50 MB of temporary free disk
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen space available. After installation Apache occupies
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen approximately 10 MB of disk space. The actual disk space
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen requirements will vary considerably based on your chosen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen configuration options and any third-party modules.<br />
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen Make sure you have an ANSI-C compiler installed. The <a
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen href="http://www.gnu.org/software/gcc/gcc.html">GNU C
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen href="http://www.gnu.org/">Free Software Foundation (FSF)</a>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen is recommended (version 2.7.2 is fine). If you don't have GCC
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen then at least make sure your vendor's compiler is ANSI
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen compliant. In addition, your <code>PATH</code> must contain
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen basic build tools such as <code>make</code>.<br />
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen Elements of the HTTP protocol are expressed as the time of
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen day. So, it's time to investigate setting some time
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen synchronization facility on your system. Usually the ntpdate
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen or xntpd programs are used for this purpose which are based
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen on the Network Time Protocol (NTP). See the Usenet newsgroup
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen href="news:comp.protocols.time.ntp">comp.protocols.time.ntp</a>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen and the <a href="http://www.eecis.udel.edu/~ntp/">NTP
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen homepage</a> for more details about NTP software and public
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen time servers.<br />
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen [OPTIONAL]<br />
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen For some of the support scripts like <a
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen href="programs/dbmmanage.html">dbmmanage</a> (which are
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen written in Perl) the Perl 5 interpreter is required (versions
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen 5.003 and 5.004 are fine). If no such interpreter is found by
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen the `configure' script there is no harm. Of course, you still
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen can build and install Apache 2.0. Only those support scripts
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen cannot be used. If you have multiple Perl interpreters
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen installed (perhaps a Perl 4 from the vendor and a Perl 5 from
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen your own), then it is recommended to use the --with-perl
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen option (see below) to make sure the correct one is selected
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen <h3><a id="download" name="download">Download</a></h3>
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen href="http://www.apache.org/dist/httpd/">Apache Software
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen href="http://www.apache.org/dyn/closer.cgi">nearby
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <p>Version numbers that end in <code>alpha</code> indicate
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen early pre-test versions which may or may not work. Version
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen numbers ending in <code>beta</code> indicate more reliable
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen releases that still require further testing or bug fixing. If
9315dd69233d554452df0c12bc57002d2042a8f4Timo Sirainen you wish to download the best available production release of
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen the Apache HTTP Server, you should choose the latest version
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen with neither <code>alpha</code> nor <code>beta</code> in its
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen filename.</p>
7889c9f65e23c83fc31cecf304cab4ab070d6aa1Timo Sirainen <p>After downloading, especially if a mirror site is used, it
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen is important to verify that you have a complete and unmodified
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen version of the Apache HTTP Server. This can be accomplished by
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen testing the downloaded tarball against the PGP signature. This,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen in turn, is a two step procedure. First, you must obtain the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen href="http://www.apache.org/dist/httpd/">Apache distribution
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen site</a>. (To assure that the <code>KEYS</code> file itself has
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen not been modified, it may be a good idea to use a file from a
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen previous distribution of Apache or import the keys from a
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen public key server.) The keys are imported into your personal
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen key ring using one of the following commands (depending on your
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen pgp version):</p>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen </blockquote>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen </blockquote>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <p>The next step is to test the tarball against the PGP
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen signature, which should always be obtained from the <a
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen href="http://www.apache.org/dist/httpd/">main Apache
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen website</a>. The signature file has a filename identical to the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen source tarball with the addition of <code>.asc</code>. Then you
3da614c39dd29f536c485089e67839b4cf89fed3Timo Sirainen can check the distribution with one of the following commands
3da614c39dd29f536c485089e67839b4cf89fed3Timo Sirainen (again, depending on your pgp version):</p>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <code>$ pgp httpd-2_0_<em>NN</em>.tar.gz.asc</code>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen </blockquote>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <code>$ gpg --verify httpd-2_0_<em>NN</em>.tar.gz.asc</code>
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen </blockquote>
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen You should receive a message like<br />
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <code>Good signature from user "Martin Kraemer
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <martin@apache.org>".</code>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen </blockquote>
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen <p>Depending on the trust relationships contained in your key
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ring, you may also receive a message saying that the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen relationship between the key and the signer of the key cannot
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen be verified. This is not a problem if you trust the
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen authenticity of the <code>KEYS</code> file.</p>
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen <h3><a id="extract" name="extract">Extract</a></h3>
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen <p>Extracting the source from the Apache HTTPD tarball is a
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen simple matter of uncompressing, and then untarring:</p>
abfcd9f73b9ad1eeef4fe6e9940383defabf68c3Timo Sirainen <code>$ gzip -d httpd-2_0_<em>NN</em>.tar.gz<br />
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen </blockquote>
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen <p>This will create a new directory under the current directory
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen containing the source code for the distribution. You should
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen <code>cd</code> into that directory before proceeding with
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen compiling the server.</p>
abfcd9f73b9ad1eeef4fe6e9940383defabf68c3Timo Sirainen <h3><a id="configure" name="configure">Configuring the source
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen <p>The next step is to configure the Apache source tree for
7394389230750c45b105cdefb5850c81cae8cdc0Timo Sirainen your particular platform and personal requirements. This is
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen done using the script <code>configure</code> included in the
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen root directory of the distribution. (Developers downloading the
7e94cf9d70ce9fdeccb7a85ff400b899e6386f36Timo Sirainen CVS version of the Apache source tree will need to have
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <code>autoconf</code> and <code>libtool</code> installed and
7e94cf9d70ce9fdeccb7a85ff400b899e6386f36Timo Sirainen will need to run <code>buildconf</code> before proceeding with
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen the next steps. This is not necessary for official
9887c39c5ba429169389153ca99de49e084a73f0Timo Sirainen releases.)</p>
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen <p>To configure the source tree using all the default options,
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen simply type <code>/configure</code>. To change the default
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen options, <code>configure</code> accepts a variety of variables
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen and command line options. Environment variables are generally
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen placed before the <code>/configure</code> command, while other
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen options are placed after. The most important option here is the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen location prefix where Apache is to be installed later, because
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen Apache has to be configured for this location to work
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen correctly. But there are a lot of other options available for
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen your pleasure.</p>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <p>For a short impression of what possibilities you have, here
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen is a typical example which compiles Apache for the installation
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen tree /sw/pkg/apache with a particular compiler and flags plus
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen the two additional modules mod_rewrite and mod_speling for
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen later loading through the DSO mechanism:</p>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen --enable-rewrite=shared \<br />
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen --enable-speling=shared</code>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen </blockquote>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <p>When configure is run it will take several minutes to test
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen for the availability of features on your system and build
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen Makefiles which will later be used to compile the server.</p>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <p>The easiest way to find all of the configuration flags for
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen Apache is to run /configure --help. What follows is a brief
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen description of most of the arguments and environment
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen variables.</p>
2ebfb5c0608e2323b73271208f4036a7ea7d7f3aTimo Sirainen <h4><a id="environment" name="environment">Environment
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <p>The autoconf build process uses several environment
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen variables to configure the build environment. In general, these
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen variables change the method used to build Apache, but not the
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen eventual features of the server. These variables can be placed
41bb0aa8e357876bc9a1916a37c9e3e78e5f8185Timo Sirainen in the environment before invoking <code>configure</code>, but
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen it is usually easier to specify them on the
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen <code>configure</code> command line as demonstrated in the
dd8de60250511cc729b67249e61dfc6b4debff11Timo Sirainen example above.</p>
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen <dd>Miscellaneous C preprocessor and compiler options.</dd>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen <dd>Debugging and optimization options for the C
659fe5d24825b160cae512538088020d97a60239Timo Sirainen compiler.</dd>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <dd>Miscellaneous options to be passed to the linker.</dd>
b35f7104715edee0cfac6d46ab0b342033867eb7Timo Sirainen <dd>Library location information ("-L" and "-l" options) to
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen pass to the linker.</dd>
51920d00fa50edf7b2e9b1019288d64b7abee7f3Timo Sirainen <dd>Header file search directories ("-I<em>dir</em>").</dd>
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen <dt><code>TARGET=...</code> [Default: apache]</dt>
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen <dd>Name of the executable which will be built.</dd>
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen <dd>These variables share the same function as their
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen non-NOTEST namesakes. However, the variables are applied to
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen the build process only after autoconf has performed its
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen feature testing. This allows the inclusion of flags which
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen will cause problems during feature testing, but must be used
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen for the final compilation.</dd>
cd5ee8630497fdbd853ef588a858b4ef619a5e03Timo Sirainen <dd>Options which specify shared library paths for the
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen compiler and linker.</dd>
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen <h4><a id="output" name="output">autoconf Output
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen <dd>Prints the usage message including all available options,
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen but does not actually configure anything.</dd>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <dd>Prevents the printing of the usual "checking..."
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen messages.</dd>
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen <dd>Prints much more information during the configuration
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen process, including the names of all the files examined.</dd>
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen <h4><a id="pathnames" name="pathnames">Pathnames</a></h4>
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen <p>There are currently two ways to configure the pathnames
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen under which Apache will install its files. First, you can
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen specify a directory and have Apache install itself under that
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen directory in its default locations.</p>
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen <dt><code>--prefix=<em>PREFIX</em></code> [Default:
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Specifies the directory under which the Apache files will
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen be installed.</dd>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen <p>It is possible to specify that architecture-dependent files
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen should be placed under a different directory.</p>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dt><code>--exec-prefix=<em>EPREFIX</em></code> [Default:
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Specifies the directory under which
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen architecture-dependent files will be placed.</dd>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>The second, and more flexible way to configure the install
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen path locations for Apache is using the
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <code>config.layout</code> file. Using this method, it is
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen possible to separately specify the location for each type of
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen file within the Apache installation. The
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <code>config.layout</code> file contains several example
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen configurations, and you can also create your own custom
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen configuration following the examples. The different layouts in
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen this file are grouped into <code><Layout
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen FOO>...</Layout></code> sections and referred to by
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dt><code>--enable-layout=<em>LAYOUT</em></code></dt>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Use the named layout in the <code>config.layout</code>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen file to specify the installation paths.</dd>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>Presently it is not possible to mix the
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <code>--enable-layout</code> and <code>--prefix</code> options.
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen Nor is it possible to individually specify detailed pathnames
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen on the <code>configure</code> command line. If you want just a
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen basic install, you can simply use the <code>--prefix</code>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen option on its own. If you want to customize your install, you
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen should edit the <code>config.layout</code> file and use the
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <h4><a id="modules" name="modules">Modules</a></h4>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>Apache is a modular server. Only the most basic
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen functionality is included in the core server. Extended features
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen are available in various modules. During the configuration
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen process, you must select which modules to compile for use with
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen your server. You can view a <a
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen href="mod/index-bytype.html">list of modules</a> included in
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen the documentation. Those modules with a <a
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen href="mod/module-dict.html#Status">status</a> of "Base" are
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen included by default and must be specifically disabled if you do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen not want them. Modules with any other status must be
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen specifically enabled if you wish to use them.</p>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>There are two ways for a module to be compiled and used with
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen Apache. Modules may be <em>statically compiled</em>, which
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen means that they are permanently included in the Apache binary.
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen Alternatively, if your operating system supports Dynamic Shared
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen Objects (DSOs) and autoconf can detect that support, then
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen modules may be <em>dynamically compiled</em>. DSO modules are
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen stored separately from the Apache binary, and may be included
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen or excluded from the server using the run-time configuration
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen directives provided by <a href="mod/mod_so.html">mod_so</a>.
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen The mod_so is automatically included in the server if any
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen dynamic modules are included in the compilation. If you would
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen like to make your server capable of loading DSOs without
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen actually compiling any dynamic modules, you can explicitly
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dt><code>--enable-<em>MODULE</em>[=shared]</code></dt>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Compile and include the module <em>MODULE</em>. The
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen href="mod/module-dict.html#ModuleIdentifier">Module
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen Identifier</a> from the module documentation without the
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen "_module" string. To compile the module as a DSO, add the
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen <dt><code>--disable-<em>MODULE</em></code></dt>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Remove the module <em>MODULE</em> which would otherwise
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen be compiled and included.</dd>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dt><code>--enable-modules=<em>MODULE-LIST</em></code></dt>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <dd>Compile and include the modules listed in the
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen <code>--enable-mods-shared=<em>MODULE-LIST</em></code></dt>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <dd>Compile and include the modules in the space-separated
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <em>MODULE-LIST</em> as dynamically loadable (DSO)
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen modules.</dd>
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen <code>--enable-mods-shared</code> options is usually a
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen space-separated list of module identifiers. For example, to
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen enable mod_dav and mod_info, you can either use</p>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <code>/configure --enable-dav --enable-info</code>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen </blockquote>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <code>/configure --enable-modules="dav info"</code>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen </blockquote>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <p>In addition, the special keywords <code>all</code> or
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <code>most</code> can be used to add all or most of the modules
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen in one step. You can then remove any modules that you do not
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen want with the <code>--disable-<em>MODULE</em></code> option.
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen For example, to include all modules as DSOs with the exception
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen of mod_info, you can use</p>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen --disable-info</code>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen </blockquote>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>In addition to the standard set of modules, Apache 2.0 also
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen includes a choice of <a href="mpm.html">Multi-Processing
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen Modules</a> (MPMs). One, and only one MPM must be included in
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen the compilation process. The default MPMs for each platform are
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen listed on the <a href="mpm.html">MPM documentation page</a>,
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen but can be overridden on the <code>configure</code> command
86d52f310fe939090c66b780a3b6ffe5d10dc8faTimo Sirainen <dt><code>--with-mpm=<em>NAME</em></code></dt>
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen <h4><a id="suexec" name="suexec">Suexec</a></h4>
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen <p>Apache includes a support program called <a
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen href="suexec.html">suexec</a> which can be used to isolate user
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen CGI programs. However, if suexec is improperly configured, it
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen can cause serious security problems. Therefore, you should
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen carefully read and consider the <a href="suexec.html">suexec
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen documentation</a> before implementing this feature.</p>
2d79e603e20a32bdae4c2b516ead5c5c9169545aTimo Sirainen <h3><a id="compile" name="compile">Build</a></h3>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <p>Now you can build the various parts which form the Apache
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen package by simply running the command:</p>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen </blockquote>
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen <p>Please be patient here, since a base configuration takes
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen approximately 3 minutes to compile under a Pentium III/Linux
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen 2.2 system, but this will vary widely depending on your
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen hardware and the number of modules which you have enabled.</p>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <h3><a id="install" name="install">Install</a></h3>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen <p>Now its time to install the package under the configured
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen installation <em>PREFIX</em> (see <code>--prefix</code> option
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen above) by running:</p>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen </blockquote>
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen <p>If you are upgrading, the installation will not overwrite
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen your configuration files or documents.</p>
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen <h3><a id="customize" name="customize">Customize</a></h3>
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen <p>Next, you can customize your Apache HTTP server by editing
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen the <a href="configuring.html">configuration files</a> under
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen <code>$ vi <em>PREFIX</em>/conf/httpd.conf</code>
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen </blockquote>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen href="http://httpd.apache.org/docs/">http://httpd.apache.org/docs/</a>
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen for a complete reference of available <a
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen href="mod/directives.html">configuration directives</a>.</p>
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen <p>Now you can <a href="invoking.html">start</a> your Apache
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen HTTP server by immediately running:</p>
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen <code>$ <em>PREFIX</em>/bin/apachectl start</code>
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen </blockquote>
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen <p>and then you should be able to request your first document
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen via URL http://localhost/. The web page you see is located
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen under the <a href="mod/core.html#documentroot">DocumentRoot</a>
91d4c7b37580b031ed7b0154ae10c643521803f3Timo Sirainen which will usually be <code><em>PREFIX</em>/htdocs/</code>.
0f66f12eb4cdbf47670975044c88d8f388bf92dfTimo Sirainen Then <a href="stopping.html">stop</a> the server again by
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen <code>$ <em>PREFIX</em>/bin/apachectl stop</code>
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen </blockquote>
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen <!--#include virtual="footer.html" -->