</div>
- <p>This document covers compilation and installation of the Apache HTTP Server
- on Unix and Unix-like systems only. For compiling and
- installation on Windows, see <a href="platform/windows.html">Using Apache HTTP Server with Microsoft
- Windows</a> and <a href="platform/win_compiling.html">Compiling Apache for Microsoft Windows</a>.
- For other platforms, see the <a href="platform/">platform</a> documentation.</p>
+ <p>The Apache HTTP Server is released as source code. This document
+ covers building and installing the server from source on Unix and
+ Unix-like systems. For Windows, see <a href="platform/windows.html">Using Apache HTTP Server with Microsoft
+ Windows</a> and <a href="platform/win_compiling.html">Compiling Apache httpd for Microsoft
+ Windows</a>. For other platforms, see the <a href="platform/">platform</a> documentation.</p>
- <p>Apache httpd uses <code>libtool</code> and <code>autoconf</code>
- to create a build environment that looks like many other Open Source
- projects.</p>
+ <p>If you install httpd from a distribution package (RPM, DEB, etc.),
+ configuration layout and defaults may differ from what is described here.
+ See <a href="#thirdp">third-party packages</a> below, and consult your
+ distribution's documentation for platform-specific details.</p>
<p>If you are upgrading from one minor version to the next (for
example, 2.4.66 to 2.4.67), please skip down to the <a href="#upgrading">upgrading</a> section.</p>
<h2 id="overview">Overview for the
impatient <a title="Permanent link" href="#overview" class="permalink">¶</a></h2>
- <dl>
- <dt>Installing on Fedora/CentOS/Red Hat Enterprise Linux</dt>
- <dd>
- <pre class="prettyprint lang-sh">sudo dnf install httpd
-
-# Start service
-sudo systemctl start httpd
-
-# Stop service
-sudo systemctl stop httpd
-
-# Restart service
-sudo systemctl restart httpd</pre>
-
-
- <div class="warning">See <a href="https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-apache-http-server/index.html">the
- Fedora project's documentation</a> for platform-specific notes.</div>
- </dd>
-
- <dt>Installing on Ubuntu/Debian</dt>
- <dd>
-<pre class="prettyprint lang-sh">sudo apt install apache2
-
-# Start service
-sudo systemctl start apache2
-
-# Stop service
-sudo systemctl stop apache2
-
-# Restart service
-sudo systemctl restart apache2</pre>
-
-
- <div class="warning">See <a href="https://ubuntu.com/tutorials/install-and-configure-apache">Ubuntu's documentation</a> for platform-specific notes.</div>
-
- </dd>
-
- <dt>Installing from source</dt>
- <dd>
<table>
<tr>
<p>Each section of the compilation and installation process is
described in more detail below, beginning with the requirements
for compiling and installing Apache httpd.</p>
- </dd>
- </dl>
-
- <div class="warning">Don't see your favorite platform mentioned
- here? <a href="https://httpd.apache.org/docs-project/">Come help us
- improve this doc.</a></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
(be sure the directory names do not have version numbers; for example,
the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use
<code>./configure</code>'s <code>--with-included-apr</code>
- option. On some platforms, you may have to install the
+ option. On some platforms, you may have to install the
corresponding <code>-dev</code> packages to allow httpd to build
against your installed copy of APR and APR-Util.</dd>
- <dt>Perl-Compatible Regular Expressions Library (PCRE)</dt>
- <dd>This library is required but no longer bundled with httpd.
- Download the source code from <a href="https://www.pcre.org/">https://www.pcre.org</a>,
- or install a Port or Package. If your build system can't find
- the pcre-config script installed by the PCRE build, point to it
- using the <code>--with-pcre</code> parameter. On some platforms,
+ <dt>Perl-Compatible Regular Expressions Library (PCRE2)</dt>
+ <dd>This library is required but not bundled with httpd.
+ Download the source code from <a href="https://github.com/PCRE2Project/pcre2">https://github.com/PCRE2Project/pcre2</a>
+ or install it from your system's package manager. If your build system can't find
+ the <code>pcre2-config</code> script installed by the PCRE2 build,
+ point to it using the <code>--with-pcre</code> parameter. On some platforms,
you may have to install the corresponding <code>-dev</code>
- package to allow httpd to build against your installed copy
- of PCRE.</dd>
+ package (e.g. <code>libpcre2-dev</code> or <code>pcre2-devel</code>)
+ to allow httpd to build against your installed copy of PCRE2.</dd>
<dt>Disk Space</dt>
<dd>Make sure you have at least 200 MB of temporary free disk
basic build tools such as <code>make</code>.</dd>
<dt>Accurate time keeping</dt>
- <dd>Elements of the HTTP protocol are expressed as the time of
- day. So, it's time to investigate setting some time
- synchronization facility on your system. Most modern Linux
- distributions provide <code>systemd-timesyncd</code> or
- <code>chrony</code> for this purpose. See the <a href="https://www.ntp.org">NTP
- homepage</a> for more details about NTP software and public
- time servers.</dd>
+ <dd>HTTP protocol headers use timestamps, so your system clock
+ must be accurate. Most Linux distributions enable
+ <code>systemd-timesyncd</code> or <code>chrony</code> by
+ default. Verify that time synchronization is active on your
+ system before running a production server.</dd>
<dt><a href="https://www.perl.org/">Perl 5</a>
[OPTIONAL]</dt>
<div class="section">
<h2 id="download">Download <a title="Permanent link" href="#download" class="permalink">¶</a></h2>
- <p>If you choose to build from source, start by downloading
- the source tarball from the <a href="https://httpd.apache.org/download.cgi">Apache HTTP Server
- download site</a>. The build process (described below)
- allows you to customize your server to suit your
- needs.</p>
+ <p>Download the source tarball from the <a href="https://httpd.apache.org/download.cgi">Apache HTTP Server
+ download site</a>.</p>
<p>After downloading, it is important to verify that you have a
complete and unmodified version of the Apache HTTP Server. This
can be accomplished by testing the downloaded tarball against the
- PGP signature. Details on how to do this are available on the
+ PGP signature. Details on how to do this are available on the
<a href="https://httpd.apache.org/dev/verification.html">verification
page</a>.</p>
<div class="section">
<h2 id="configure">Configuring the source tree <a title="Permanent link" href="#configure" class="permalink">¶</a></h2>
- <p>The next step is to configure the Apache source tree for your
+ <p>The next step is to configure the httpd source tree for your
particular platform and personal requirements. This is done using
the script <code class="program"><a href="./programs/configure.html">configure</a></code> included in
the root directory of the distribution. (Developers downloading
- an unreleased version of the Apache source tree will need to have
+ an unreleased version of the httpd 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>
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
+ where httpd is to be installed later, because httpd 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
+ want included in httpd by enabling and disabling <a href="mod/">modules</a>. httpd 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></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
+ to a dash. Similarly, you can disable modules with the
+ <code>--disable-<var>module</var></code> option. Be careful when
using these options, since <code class="program"><a href="./programs/configure.html">configure</a></code> cannot warn you
if the module you specify does not exist; it will ignore the option.</p>
<p>In addition, it is sometimes necessary to provide the
<code class="program"><a href="./programs/configure.html">configure</a></code> script with extra information about the
- location of your compiler, libraries, or header files. This is
+ location of your compiler, libraries, or header files. This is
done by passing either environment variables or command line
- options to <code class="program"><a href="./programs/configure.html">configure</a></code>. For more information, see the
+ options to <code class="program"><a href="./programs/configure.html">configure</a></code>. For more information, see the
<code class="program"><a href="./programs/configure.html">configure</a></code> manual page. Or invoke
<code class="program"><a href="./programs/configure.html">configure</a></code> 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
+ is a typical example which compiles httpd for the installation
tree <code>/sw/pkg/apache</code> with a particular compiler and flags
plus the two additional modules <code class="module"><a href="./mod/mod_ldap.html">mod_ldap</a></code> and
<code class="module"><a href="./mod/mod_lua.html">mod_lua</a></code>:</p>
<div class="section">
<h2 id="compile">Build <a title="Permanent link" href="#compile" class="permalink">¶</a></h2>
- <p>Now you can build the various parts which form the Apache
+ <p>Now you can build the various parts which form the httpd
package by running:</p>
-<div class="example"><p><code>$ make</code></p></div>
+<div class="example"><pre class="prettyprint lang-sh">$ make</pre>
+</div>
<p>Please be patient here, since a base configuration takes
several minutes to compile and the time will vary widely
installation <em>PREFIX</em> (see <code>--prefix</code> option
above) by running:</p>
-<div class="example"><p><code>$ make install</code></p></div>
+<div class="example"><pre class="prettyprint lang-sh">$ make install</pre>
+</div>
<p>This step will typically require root privileges, since
<em>PREFIX</em> is usually a directory with restricted write
<div class="section">
<h2 id="customize">Customize <a title="Permanent link" href="#customize" class="permalink">¶</a></h2>
- <p>Next, you can customize your Apache HTTP server by editing
+ <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>
-<div class="example"><p><code>$ vi <em>PREFIX</em>/conf/httpd.conf</code></p></div>
+<div class="example"><pre class="prettyprint lang-sh">$ vi <em>PREFIX</em>/conf/httpd.conf</pre>
+</div>
- <p>Have a look at the Apache manual under
+ <p>Have a look at the httpd manual under
<code><em>PREFIX</em>/docs/manual/</code> or consult <a href="https://httpd.apache.org/docs/2.4/">https://httpd.apache.org/docs/2.4/</a> for the most recent
version of this manual and a complete reference of available <a href="mod/directives.html">configuration directives</a>.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="test">Test <a title="Permanent link" href="#test" class="permalink">¶</a></h2>
- <p>Now you can <a href="invoking.html">start</a> your Apache
- HTTP server by immediately running:</p>
+ <p>Now you can <a href="invoking.html">start</a> your Apache HTTP Server by immediately running:</p>
-<div class="example"><p><code>$ <em>PREFIX</em>/bin/apachectl -k start</code></p></div>
+<div class="example"><pre class="prettyprint lang-sh">$ <em>PREFIX</em>/bin/apachectl -k start</pre>
+</div>
<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
Then <a href="stopping.html">stop</a> the server again by
running:</p>
-<div class="example"><p><code>$ <em>PREFIX</em>/bin/apachectl -k stop</code></p></div>
+<div class="example"><pre class="prettyprint lang-sh">$ <em>PREFIX</em>/bin/apachectl -k stop</pre>
+</div>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="upgrading">Upgrading <a title="Permanent link" href="#upgrading" class="permalink">¶</a></h2>
<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
+ find any changes that may affect your site. When changing between
major releases (for example, from 2.4 to 2.6),
there will likely be major differences in the compile-time and
- run-time configuration that will require manual adjustments. All
+ run-time configuration that will require manual adjustments. All
modules will also need to be upgraded to accommodate changes in the
module API.</p>
<p>Upgrading from one minor version to the next (for example, from
- 2.4.66 to 2.4.67) is easier. The <code>make install</code>
+ 2.4.66 to 2.4.67) 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
+ files, or configuration files. In addition, the developers make
every effort to avoid incompatible changes in the
<code class="program"><a href="./programs/configure.html">configure</a></code> options, run-time configuration, or the
- module API between minor versions. In most cases you should be able to
+ module API between minor versions. In most cases you should be able to
use an identical <code class="program"><a href="./programs/configure.html">configure</a></code> 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
+ old install. This will contain the exact
<code class="program"><a href="./programs/configure.html">configure</a></code> command line that you used to
- configure the source tree. Then to upgrade from one version 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>
</div>
<div class="warning">You should always test any new version in your
- environment before putting it into production. For example, you
+ 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 <code class="directive"><a href="./mod/mpm_common.html#listen">Listen</a></code> directive) to test for any
which will be appended to your original <code class="program"><a href="./programs/configure.html">configure</a></code>
options:</p>
- <div class="example"><p><code>
- $ ./config.nice --prefix=/home/test/apache --with-port=90
- </code></p></div>
+ <div class="example"><pre class="prettyprint lang-sh">$ ./config.nice --prefix=/home/test/apache --with-port=90</pre>
+</div>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="thirdp">Third-party packages <a title="Permanent link" href="#thirdp" class="permalink">¶</a></h2>
- <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
- <a href="https://httpd.apache.org/docs/trunk/en/platform/windows.html">Windows</a>
- packages, macOS, and many more.</p>
+ <p>Many operating systems ship pre-built Apache httpd packages.
+ These are convenient for getting started quickly, but they often
+ differ from a source build in configuration file layout,
+ compiled-in modules, and default paths. The documentation on this
+ site describes the server as built from source; if you are using a
+ platform package, consult your distribution's documentation for
+ platform-specific details.</p>
+
+ <p>Some common examples:</p>
+
+ <dl>
+ <dt>Fedora / CentOS / Red Hat Enterprise Linux</dt>
+ <dd>
+ <pre class="prettyprint lang-sh">sudo dnf install httpd
+sudo systemctl start httpd</pre>
+
+ <p>See <a href="https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-apache-http-server/index.html">the
+ Fedora project's documentation</a> for configuration layout and
+ platform-specific notes.</p>
+ </dd>
+
+ <dt>Ubuntu / Debian</dt>
+ <dd>
+<pre class="prettyprint lang-sh">sudo apt install apache2
+sudo systemctl start apache2</pre>
+
+ <p>See <a href="https://ubuntu.com/tutorials/install-and-configure-apache">Ubuntu's
+ documentation</a> for configuration layout and
+ platform-specific notes.</p>
+ </dd>
+ </dl>
<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="https://cwiki.apache.org/confluence/display/httpd/DistrosDefaultLayout">description
- of these third-party distributions</a> is in the HTTP
- Server wiki. However, you will need to familiarize
- yourself with your particular platform's package management and
- installation procedures.</p>
+ may differ from what is stated in the documentation. A <a href="https://cwiki.apache.org/confluence/display/httpd/DistrosDefaultLayout">description
+ of these third-party distributions</a> is available in the HTTP
+ Server wiki.</p>
+
+ <div class="warning">Don't see your favorite platform mentioned
+ here? <a href="https://httpd.apache.org/docs-project/">Come help us
+ improve this doc.</a></div>
</div></div>
<div class="bottomlang">