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