|
|
fb3f8d |
|
|
|
fb3f8d |
|
|
|
fb3f8d |
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
|
|
|
fb3f8d |
|
|
|
fb3f8d |
]>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
Copyright 2018 Red Hat, Inc.
|
|
|
fb3f8d |
|
|
|
fb3f8d |
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
fb3f8d |
contributor license agreements. See the NOTICE file distributed with
|
|
|
fb3f8d |
this work for additional information regarding copyright ownership.
|
|
|
fb3f8d |
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
fb3f8d |
(the "License"); you may not use this file except in compliance with
|
|
|
fb3f8d |
the License. You may obtain a copy of the License at
|
|
|
fb3f8d |
|
|
|
fb3f8d |
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
fb3f8d |
|
|
|
fb3f8d |
Unless required by applicable law or agreed to in writing, software
|
|
|
fb3f8d |
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
fb3f8d |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
fb3f8d |
See the License for the specific language governing permissions and
|
|
|
fb3f8d |
limitations under the License.
|
|
|
fb3f8d |
-->
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refentry>
|
|
|
fb3f8d |
<refentryinfo>
|
|
|
fb3f8d |
<title>httpd.conf</title>
|
|
|
fb3f8d |
<productname>httpd</productname>
|
|
|
fb3f8d |
<author><contrib>Author</contrib><surname>Orton</surname><firstname>Joe</firstname><email>jorton@redhat.com</email></author>
|
|
|
fb3f8d |
</refentryinfo>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refmeta>
|
|
|
fb3f8d |
<refentrytitle>httpd.conf</refentrytitle>
|
|
|
fb3f8d |
<manvolnum>5</manvolnum>
|
|
|
fb3f8d |
</refmeta>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refnamediv>
|
|
|
fb3f8d |
<refname>httpd.conf</refname>
|
|
|
fb3f8d |
<refpurpose>Configuration files for httpd</refpurpose>
|
|
|
fb3f8d |
</refnamediv>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsynopsisdiv>
|
|
|
fb3f8d |
<para>
|
|
|
fb3f8d |
<filename>/etc/httpd/conf/httpd.conf</filename>,
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.modules.d</filename>,
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.d</filename>
|
|
|
fb3f8d |
</para>
|
|
|
fb3f8d |
</refsynopsisdiv>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect1>
|
|
|
fb3f8d |
<title>Description</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>The main configuration file for the <command>httpd</command> daemon is
|
|
|
fb3f8d |
<filename>/etc/httpd/conf/httpd.conf</filename>. The syntax of
|
|
|
fb3f8d |
this file is described at
|
|
|
fb3f8d |
url="https://httpd.apache.org/docs/2.4/configuring.html"/>, and
|
|
|
fb3f8d |
the full set of available directives is listed at
|
|
|
fb3f8d |
url="https://httpd.apache.org/docs/2.4/mod/directives.html"/>.
|
|
|
fb3f8d |
</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect2>
|
|
|
fb3f8d |
<title>Configuration structure</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>The main configuration file
|
|
|
fb3f8d |
(<filename>httpd.conf</filename>) sets up various defaults and
|
|
|
fb3f8d |
includes configuration files from two directories -
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.modules.d</filename> and
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.d</filename>. Packages containing
|
|
|
fb3f8d |
loadable modules (like <option>mod_ssl.so</option>) place files
|
|
|
fb3f8d |
in the <filename>conf.modules.d</filename> directory with the
|
|
|
fb3f8d |
appropriate <option>LoadModule</option> directive so that module
|
|
|
fb3f8d |
is loaded by default.</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>Some notable configured defaults are:.</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<variablelist>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><option>DocumentRoot @DOCROOT@/html</option></term>
|
|
|
fb3f8d |
<listitem><para>The default document root from which content
|
|
|
fb3f8d |
is served.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><option>Listen 80</option></term>
|
|
|
fb3f8d |
<listitem><para>The daemon lists on TCP port 80.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><option>ErrorLog "logs/error_log"</option></term>
|
|
|
fb3f8d |
<listitem><para>Error messages are logged to
|
|
|
fb3f8d |
<filename>@LOGDIR@/error_log</filename>.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><option>ScriptAlias /cgi-bin/ "@DOCROOT@/cgi-bin/"</option></term>
|
|
|
fb3f8d |
<listitem><para>CGI scripts are served via the URL-path <option>/cgi-bin/</option>.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
</variablelist>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>To remove any of the default configuration provided in
|
|
|
fb3f8d |
separate files covered below, replace that file with an empty
|
|
|
fb3f8d |
file rather than removing it from the filesystem, otherwise it
|
|
|
fb3f8d |
may be restored to the original when the package which provides
|
|
|
fb3f8d |
it is upgraded.</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
</refsect2>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect2>
|
|
|
fb3f8d |
<title>MPM configuration</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>The configuration file at
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.modules.d/00-mpm.conf</filename> is
|
|
|
fb3f8d |
used to select the multi-processing module (MPM), which governs
|
|
|
fb3f8d |
how <command>httpd</command> divides work between processes
|
|
|
fb3f8d |
and/or threads at run-time. Exactly one
|
|
|
fb3f8d |
<option>LoadModule</option> directive must be uncommented in
|
|
|
fb3f8d |
this file; by default the <option>@MPM@</option> MPM is enabled.
|
|
|
fb3f8d |
For more information on MPMs, see
|
|
|
fb3f8d |
url="https://httpd.apache.org/docs/2.4/mpm.html"/>.</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>If using the <emphasis>prefork</emphasis> MPM, the
|
|
|
fb3f8d |
"httpd_graceful_shutdown" SELinux boolean should also be
|
|
|
fb3f8d |
enabled, since with this MPM, httpd needs to establish TCP
|
|
|
fb3f8d |
connections to local ports to successfully complete a graceful
|
|
|
fb3f8d |
restart or shutdown. This boolean can be enabled by running the
|
|
|
fb3f8d |
command: <command>semanage boolean -m --on
|
|
|
fb3f8d |
httpd_graceful_shutdown</command></para>
|
|
|
fb3f8d |
</refsect2>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect2>
|
|
|
fb3f8d |
<title>Module configuration files</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>Module configuration files are provided in the
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.modules.d/</filename> directory. Filenames
|
|
|
fb3f8d |
in this directory are by convention prefixed with two digit numeric
|
|
|
fb3f8d |
prefix to ensure they are processed in the desired order. Core
|
|
|
fb3f8d |
modules provide with the <command>httpd</command> package are
|
|
|
fb3f8d |
loaded by files with a <option>0x-</option> prefix to ensure
|
|
|
fb3f8d |
these are loaded first. Only filenames with a
|
|
|
fb3f8d |
<option>.conf</option> suffix in this directory will be
|
|
|
fb3f8d |
processed.</para>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>Other provided configuration files are listed below.
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<variablelist>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.modules.d/00-base.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>The set of core modules included with
|
|
|
fb3f8d |
<command>httpd</command> which are all loaded by
|
|
|
fb3f8d |
default.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.modules.d/00-optional.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>The set of non-core modules included with
|
|
|
fb3f8d |
<command>httpd</command> which are <emphasis>not</emphasis>
|
|
|
fb3f8d |
loaded by default.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.modules.d/00-systemd.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>This file loads <option>mod_systemd</option>
|
|
|
fb3f8d |
which is necessary for the correct operation of the
|
|
|
fb3f8d |
<command>httpd.service</command> service, and should not be
|
|
|
fb3f8d |
removed or disabled.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
</variablelist>
|
|
|
fb3f8d |
</para>
|
|
|
fb3f8d |
</refsect2>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect2>
|
|
|
fb3f8d |
<title>Other configuration files</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>Default module configuration files and site-specific
|
|
|
fb3f8d |
configuration files are loaded from the
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.d/</filename> directory. Only files
|
|
|
fb3f8d |
with a <option>.conf</option> suffix will be loaded. The
|
|
|
fb3f8d |
following files are provided:
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<variablelist>
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.d/userdir.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>This file gives an example configuration for
|
|
|
fb3f8d |
<option>mod_userdir</option> to map URLs such as
|
|
|
fb3f8d |
<option>http://localhost/~jim/</option> to
|
|
|
fb3f8d |
<filename>/home/jim/public_html/</filename>. Userdir mapping
|
|
|
fb3f8d |
is disabled by default.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.d/autoindex.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>This file provides the default configuration
|
|
|
fb3f8d |
for <option>mod_autoindex</option> which generates HTML
|
|
|
fb3f8d |
directory listings when enabled. It also makes file icon
|
|
|
fb3f8d |
image files available at the <option>/icons/</option>
|
|
|
fb3f8d |
URL-path.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.d/welcome.conf</filename></term>
|
|
|
fb3f8d |
<listitem><para>This file enables a "welcome page" at
|
|
|
fb3f8d |
<option>http://localhost/</option> if no content is present
|
|
|
fb3f8d |
in the default documentation root
|
|
|
fb3f8d |
<filename>/var/www/html</filename>.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<varlistentry>
|
|
|
fb3f8d |
<term><filename>/etc/httpd/conf.d/ssl.conf</filename> (present only if <option>mod_ssl</option> is installed)</term>
|
|
|
fb3f8d |
<listitem><para>This file configures a TLS
|
|
|
fb3f8d |
<option>VirtualHost</option> listening on port
|
|
|
fb3f8d |
<option>443</option>. If the default configuration is used,
|
|
|
fb3f8d |
the referenced test certificate and private key are
|
|
|
fb3f8d |
generated the first time <command>httpd.service</command> is
|
|
|
fb3f8d |
started; see
|
|
|
fb3f8d |
<citerefentry><refentrytitle>httpd-init.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
|
|
fb3f8d |
for more information.</para></listitem>
|
|
|
fb3f8d |
</varlistentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
</variablelist></para>
|
|
|
fb3f8d |
</refsect2>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect2>
|
|
|
fb3f8d |
<title>Instantiated services</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>As an alternative to (or in addition to) the
|
|
|
fb3f8d |
<command>httpd.service</command> unit, the instantiated template
|
|
|
fb3f8d |
service <command>httpd@.service</command> unit file can be used,
|
|
|
fb3f8d |
which starts <command>httpd</command> using a different
|
|
|
fb3f8d |
configuration file to the default. For example,
|
|
|
fb3f8d |
<command>systemctl start httpd@foobar.service</command> will
|
|
|
fb3f8d |
start httpd using the configuration file
|
|
|
fb3f8d |
<filename>/etc/httpd/conf/foobar.conf</filename>. See <citerefentry><refentrytitle>httpd@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> for more information.</para>
|
|
|
fb3f8d |
</refsect2>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
</refsect1>
|
|
|
fb3f8d |
<refsect1>
|
|
|
fb3f8d |
<title>Files</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>
|
|
|
fb3f8d |
<filename>/etc/httpd/conf/httpd.conf</filename>,
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.d</filename>,
|
|
|
fb3f8d |
<filename>/etc/httpd/conf.modules.d</filename>
|
|
|
fb3f8d |
</para>
|
|
|
fb3f8d |
</refsect1>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<refsect1>
|
|
|
fb3f8d |
<title>See also</title>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
<para>
|
|
|
fb3f8d |
<citerefentry><refentrytitle>httpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
|
|
fb3f8d |
<citerefentry><refentrytitle>httpd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
|
|
fb3f8d |
<ulink url="https://httpd.apache.org/docs/2.4/configuring.html"/>,
|
|
|
fb3f8d |
<ulink url="https://httpd.apache.org/docs/2.4/mod/directives.html"/>
|
|
|
fb3f8d |
</para>
|
|
|
fb3f8d |
</refsect1>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
</refentry>
|
|
|
fb3f8d |
|
|
|
fb3f8d |
|
|
|
fb3f8d |
-->
|