Blame SOURCES/httpd.conf.xml

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