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