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