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