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