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