install.xml revision 26932bb82a7d30e9cfb22fba22bcfe0cc5df53fb
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<manualpage>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen <p>This document covers compilation and installation of Apache
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen on Unix and Unix-like systems only. For compiling and
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen installation on Windows, see <a
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen href="platform/windows.html">Using Apache with Microsoft
3f08db06526d6901aa08c110b5bc7dde6bc39905nd <p>Apache 2.0's configuration and installation environment has
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd changed completely from Apache 1.3. Apache 1.3 used a custom
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd set of scripts to achieve easy installation. Apache 2.0 now
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd uses libtool and autoconf to create an environment that looks
3f08db06526d6901aa08c110b5bc7dde6bc39905nd like many other Open Source projects.</p>
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi impatient</title>
16c3dab75292d97eca6698f695f5012c16f86011slive http://www.apache.org/dist/httpd/httpd-2_0_<em>NN</em>.tar.gz</code>
16c3dab75292d97eca6698f695f5012c16f86011slive <td><code>$ gzip -d httpd-2_0_<em>NN</em>.tar.gz<br />
16c3dab75292d97eca6698f695f5012c16f86011slive <td><code>$ vi <em>PREFIX</em>/conf/httpd.conf</code> </td>
16c3dab75292d97eca6698f695f5012c16f86011slive <td><code>$ <em>PREFIX</em>/bin/apachectl start</code>
16c3dab75292d97eca6698f695f5012c16f86011slive <p><em>NN</em> must be replaced with the current minor version
4e191199a0aeab09d78df8f5579e745572e8b7bcwsanchez number, and <em>PREFIX</em> must be replaced with the
4e191199a0aeab09d78df8f5579e745572e8b7bcwsanchez filesystem path under which the server should be installed. If
16c3dab75292d97eca6698f695f5012c16f86011slive <p>Each section of the compilation and installation process is
16c3dab75292d97eca6698f695f5012c16f86011slive described in more detail below, beginning with the requirements
16c3dab75292d97eca6698f695f5012c16f86011slive for compiling and installing Apache HTTPD.</p>
16c3dab75292d97eca6698f695f5012c16f86011slive <p>The following requirements exist for building Apache:</p>
16c3dab75292d97eca6698f695f5012c16f86011slive Make sure you have at least 50 MB of temporary free disk
16c3dab75292d97eca6698f695f5012c16f86011slive space available. After installation Apache occupies
16c3dab75292d97eca6698f695f5012c16f86011slive approximately 10 MB of disk space. The actual disk space
16c3dab75292d97eca6698f695f5012c16f86011slive requirements will vary considerably based on your chosen
16c3dab75292d97eca6698f695f5012c16f86011slive configuration options and any third-party modules.<br />
16c3dab75292d97eca6698f695f5012c16f86011slive Make sure you have an ANSI-C compiler installed. The <a
16c3dab75292d97eca6698f695f5012c16f86011slive href="http://www.gnu.org/">Free Software Foundation (FSF)</a>
16c3dab75292d97eca6698f695f5012c16f86011slive is recommended (version 2.7.2 is fine). If you don't have GCC
16c3dab75292d97eca6698f695f5012c16f86011slive then at least make sure your vendor's compiler is ANSI
16c3dab75292d97eca6698f695f5012c16f86011slive compliant. In addition, your <code>PATH</code> must contain
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd Elements of the HTTP protocol are expressed as the time of
16c3dab75292d97eca6698f695f5012c16f86011slive day. So, it's time to investigate setting some time
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd synchronization facility on your system. Usually the ntpdate
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd or xntpd programs are used for this purpose which are based
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd on the Network Time Protocol (NTP). See the Usenet newsgroup
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd href="news:comp.protocols.time.ntp">comp.protocols.time.ntp</a>
16c3dab75292d97eca6698f695f5012c16f86011slive homepage</a> for more details about NTP software and public
16c3dab75292d97eca6698f695f5012c16f86011slive time servers.<br />
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd [OPTIONAL]<br />
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd For some of the support scripts like <a
16c3dab75292d97eca6698f695f5012c16f86011slive written in Perl) the Perl 5 interpreter is required (versions
16c3dab75292d97eca6698f695f5012c16f86011slive 5.003 or newer are sufficient). If no such interpreter is found by
16c3dab75292d97eca6698f695f5012c16f86011slive the `configure' script there is no harm. Of course, you still
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd can build and install Apache 2.0. Only those support scripts
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd cannot be used. If you have multiple Perl interpreters
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd installed (perhaps a Perl 4 from the vendor and a Perl 5 from
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd your own), then it is recommended to use the --with-perl
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd option (see below) to make sure the correct one is selected
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd href="http://www.apache.org/dist/httpd/">Apache Software
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd href="http://www.apache.org/dyn/closer.cgi/httpd/">nearby
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>Version numbers that end in <code>alpha</code> indicate
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd early pre-test versions which may or may not work. Version
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd numbers ending in <code>beta</code> indicate more reliable
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd releases that still require further testing or bug fixing. If
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd you wish to download the best available production release of
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd the Apache HTTP Server, you should choose the latest version
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd with neither <code>alpha</code> nor <code>beta</code> in its
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd filename.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>After downloading, especially if a mirror site is used, it
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd is important to verify that you have a complete and unmodified
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd version of the Apache HTTP Server. This can be accomplished by
71fccc298df6a1540d408151a26aa22beed55d0bnd testing the downloaded tarball against the PGP signature. This,
71fccc298df6a1540d408151a26aa22beed55d0bnd in turn, is a two step procedure. First, you must obtain the
71fccc298df6a1540d408151a26aa22beed55d0bnd href="http://www.apache.org/dist/httpd/">Apache distribution
71fccc298df6a1540d408151a26aa22beed55d0bnd site</a>. (To assure that the <code>KEYS</code> file itself has
71fccc298df6a1540d408151a26aa22beed55d0bnd not been modified, it may be a good idea to use a file from a
71fccc298df6a1540d408151a26aa22beed55d0bnd previous distribution of Apache or import the keys from a
71fccc298df6a1540d408151a26aa22beed55d0bnd public key server.) The keys are imported into your personal
16c3dab75292d97eca6698f695f5012c16f86011slive key ring using one of the following commands (depending on your
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd pgp version):</p>
16c3dab75292d97eca6698f695f5012c16f86011slive <p>The next step is to test the tarball against the PGP
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd signature, which should always be obtained from the <a
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd href="http://www.apache.org/dist/httpd/">main Apache
16c3dab75292d97eca6698f695f5012c16f86011slive website</a>. The signature file has a filename identical to the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd source tarball with the addition of <code>.asc</code>. Then you
71fccc298df6a1540d408151a26aa22beed55d0bnd can check the distribution with one of the following commands
71fccc298df6a1540d408151a26aa22beed55d0bnd (again, depending on your pgp version):</p>
16c3dab75292d97eca6698f695f5012c16f86011slive<example>$ pgp httpd-2_0_<em>NN</em>.tar.gz.asc</example>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<example>$ gpg --verify httpd-2_0_<em>NN</em>.tar.gz.asc</example>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<example>Good signature from user "Martin Kraemer
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <martin@apache.org>".</example>
71fccc298df6a1540d408151a26aa22beed55d0bnd <p>Depending on the trust relationships contained in your key
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd ring, you may also receive a message saying that the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd relationship between the key and the signer of the key cannot
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd be verified. This is not a problem if you trust the
71fccc298df6a1540d408151a26aa22beed55d0bnd <p>Extracting the source from the Apache HTTPD tarball is a
71fccc298df6a1540d408151a26aa22beed55d0bnd simple matter of uncompressing, and then untarring:</p>
71fccc298df6a1540d408151a26aa22beed55d0bnd <p>This will create a new directory under the current directory
71fccc298df6a1540d408151a26aa22beed55d0bnd containing the source code for the distribution. You should
71fccc298df6a1540d408151a26aa22beed55d0bnd <code>cd</code> into that directory before proceeding with
71fccc298df6a1540d408151a26aa22beed55d0bnd compiling the server.</p>
71fccc298df6a1540d408151a26aa22beed55d0bnd<section id="configure"><title>Configuring the source tree</title>
71fccc298df6a1540d408151a26aa22beed55d0bnd <p>The next step is to configure the Apache source tree for
71fccc298df6a1540d408151a26aa22beed55d0bnd your particular platform and personal requirements. This is
71fccc298df6a1540d408151a26aa22beed55d0bnd done using the script <code>configure</code> included in the
71fccc298df6a1540d408151a26aa22beed55d0bnd root directory of the distribution. (Developers downloading the
71fccc298df6a1540d408151a26aa22beed55d0bnd CVS version of the Apache source tree will need to have
71fccc298df6a1540d408151a26aa22beed55d0bnd <code>autoconf</code> and <code>libtool</code> installed and
71fccc298df6a1540d408151a26aa22beed55d0bnd will need to run <code>buildconf</code> before proceeding with
71fccc298df6a1540d408151a26aa22beed55d0bnd the next steps. This is not necessary for official
16c3dab75292d97eca6698f695f5012c16f86011slive releases.)</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>To configure the source tree using all the default options,
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd simply type <code>/configure</code>. To change the default
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd options, <code>configure</code> accepts a variety of variables
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd and command line options. Environment variables are generally
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd placed before the <code>/configure</code> command, while other
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd options are placed after. The most important option here is the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd location prefix where Apache is to be installed later, because
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd Apache has to be configured for this location to work
16c3dab75292d97eca6698f695f5012c16f86011slive correctly. But there are a lot of other options available for
16c3dab75292d97eca6698f695f5012c16f86011slive your pleasure.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>For a short impression of what possibilities you have, here
16c3dab75292d97eca6698f695f5012c16f86011slive is a typical example which compiles Apache for the installation
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd tree /sw/pkg/apache with a particular compiler and flags plus
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd the two additional modules mod_rewrite and mod_speling for
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd later loading through the DSO mechanism:</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd $ CC="pgcc" CFLAGS="-O2" \<br />
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd --enable-rewrite=shared \<br />
16c3dab75292d97eca6698f695f5012c16f86011slive --enable-speling=shared
16c3dab75292d97eca6698f695f5012c16f86011slive <p>When configure is run it will take several minutes to test
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd for the availability of features on your system and build
16c3dab75292d97eca6698f695f5012c16f86011slive Makefiles which will later be used to compile the server.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>The easiest way to find all of the configuration flags for
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd Apache is to run /configure --help. What follows is a brief
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd description of most of the arguments and environment
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd variables.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd<section id="environment"><title>Environment Variables</title>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <p>The autoconf build process uses several environment
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd variables to configure the build environment. In general, these
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd variables change the method used to build Apache, but not the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd eventual features of the server. These variables can be placed
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd in the environment before invoking <code>configure</code>, but
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd it is usually easier to specify them on the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <code>configure</code> command line as demonstrated in the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd example above.</p>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <dd>Miscellaneous C preprocessor and compiler options.</dd>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <dd>Debugging and optimization options for the C
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd compiler.</dd>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <dd>Miscellaneous options to be passed to the linker.</dd>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd <dd>Library location information ("-L" and "-l" options) to
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd pass to the linker.</dd>
71fccc298df6a1540d408151a26aa22beed55d0bnd <dd>Header file search directories ("-I<em>dir</em>").</dd>
71fccc298df6a1540d408151a26aa22beed55d0bnd <dd>These variables share the same function as their
71fccc298df6a1540d408151a26aa22beed55d0bnd non-NOTEST namesakes. However, the variables are applied to
71fccc298df6a1540d408151a26aa22beed55d0bnd the build process only after autoconf has performed its
71fccc298df6a1540d408151a26aa22beed55d0bnd feature testing. This allows the inclusion of flags which
71fccc298df6a1540d408151a26aa22beed55d0bnd will cause problems during feature testing, but must be used
71fccc298df6a1540d408151a26aa22beed55d0bnd for the final compilation.</dd>
71fccc298df6a1540d408151a26aa22beed55d0bnd <dd>Options which specify shared library paths for the
71fccc298df6a1540d408151a26aa22beed55d0bnd compiler and linker.</dd>
71fccc298df6a1540d408151a26aa22beed55d0bnd<section id="output"><title>autoconf Output Options</title>
71fccc298df6a1540d408151a26aa22beed55d0bnd <dd>Prints the usage message including all available options,
71fccc298df6a1540d408151a26aa22beed55d0bnd but does not actually configure anything.</dd>
71fccc298df6a1540d408151a26aa22beed55d0bnd <dd>Prevents the printing of the usual "checking..."
71fccc298df6a1540d408151a26aa22beed55d0bnd messages.</dd>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <dd>Prints much more information during the configuration
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi process, including the names of all the files examined.</dd>
0d0ba3a410038e179b695446bb149cce6264e0abnd <p>There are currently two ways to configure the pathnames
727872d18412fc021f03969b8641810d8896820bhumbedooh under which Apache will install its files. First, you can
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh specify a directory and have Apache install itself under that
0d0ba3a410038e179b695446bb149cce6264e0abnd directory in its default locations.</p>
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh <dd>Specifies the directory under which the Apache files will
0d0ba3a410038e179b695446bb149cce6264e0abnd be installed.</dd>
727872d18412fc021f03969b8641810d8896820bhumbedooh <p>It is possible to specify that architecture-dependent files
0d0ba3a410038e179b695446bb149cce6264e0abnd should be placed under a different directory.</p>
1a1356f375e36db7bee379ea0684ab389579f798rbowen <dt><code>--exec-prefix=<em>EPREFIX</em></code> [Default:
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd <dd>Specifies the directory under which
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd architecture-dependent files will be placed.</dd>
href="mod/module-dict.html#ModuleIdentifier">Module
/configure --enable-mods-shared=all
via URL http://localhost/. The web page you see is located