Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Naming /etc/httpd/conf.d/*.conf files in apache 2.4 on RHEL 7?

    Posted on

    How do I decide what names to give configuration files that I need to create and place in /etc/httpd/conf.d? I need to change some of the default values of directives, and I understand that I need to put them in file(s) that end with .conf in that directory, but how do I decide on the part to the left of the .conf?

    Example: /etc/httpd/conf/httpd.conf has this block:

    
        DirectoryIndex index.html
    
    

    while my 2.0/2.2 servers have the block:

    DirectoryIndex index.html index.html.var index.jsp
    

    I understand that I need to stick a file in /etc/httpd/conf.d/ and have the lines:

    
        DirectoryIndex index.html index.html.var index.jsp
    
    

    be in that file.

    Ok, how do I decide what to name the file? Surely the apache gurus don't intend for the chaos of having every site have a different name for their little file -- DirectoryIndex.conf, directory_index.conf, dir_indx.conf, indexdir.conf, etc. And if like things ought to be grouped together (as in the conf.d/userdir.conf sample file) then how do we know what the canonical way is to structure all that?

    Am I missing a piece of the install that documents/templates all that out?

    Other details:
    I have a new RHEL 7 server that was built for me by our systems group, and I have installed apache on it as specified in the manual

         yum install httpd
    

    That gets me the executables, and a skeleton of the configuration:

    $ ls -Rl /etc/httpd
    /etc/httpd:
    total 0
    drwxr-xr-x 2 root root  35 Dec 14 01:30 conf
    drwxr-xr-x 2 root root  78 Dec 14 01:30 conf.d
    drwxr-xr-x 2 root root 139 Dec 14 01:30 conf.modules.d
    lrwxrwxrwx 1 root root  19 Dec 14 01:30 logs -> ../../var/log/httpd
    lrwxrwxrwx 1 root root  29 Dec 14 01:30 modules -> ../../usr/lib64/httpd/modules
    lrwxrwxrwx 1 root root  10 Dec 14 01:30 run -> /run/httpd
    
    /etc/httpd/conf:
    total 28
    -rw-r--r-- 1 root root 11753 Aug  3 12:24 httpd.conf
    -rw-r--r-- 1 root root 13077 Aug  3 12:33 magic
    
    /etc/httpd/conf.d:
    total 16
    -rw-r--r-- 1 root root 2926 Aug  3 12:33 autoindex.conf
    -rw-r--r-- 1 root root  366 Aug  3 12:34 README
    -rw-r--r-- 1 root root 1252 Aug  3 12:24 userdir.conf
    -rw-r--r-- 1 root root  516 Aug  3 12:24 welcome.conf
    
    /etc/httpd/conf.modules.d:
    total 28
    -rw-r--r-- 1 root root 3739 Aug  3 12:24 00-base.conf
    -rw-r--r-- 1 root root  139 Aug  3 12:24 00-dav.conf
    -rw-r--r-- 1 root root   41 Aug  3 12:24 00-lua.conf
    -rw-r--r-- 1 root root  742 Aug  3 12:24 00-mpm.conf
    -rw-r--r-- 1 root root  957 Aug  3 12:24 00-proxy.conf
    -rw-r--r-- 1 root root   88 Aug  3 12:24 00-systemd.conf
    -rw-r--r-- 1 root root  451 Aug  3 12:24 01-cgi.conf
    

    Notice that there are only 3 .conf files in conf.d. Ok, then later on in the manual there is reference to /usr/share/doc/httpd-VERSION, which looks like this:

    $ ls -l /usr/share/doc/httpd-2.4.6/
    total 244
    -rw-r--r-- 1 root root  13507 Mar 29  2011 ABOUT_APACHE
    -rw-r--r-- 1 root root 138742 Jul 15  2013 CHANGES
    -rw-r--r-- 1 root root   1797 Aug  3 12:33 httpd-dav.conf
    -rw-r--r-- 1 root root   2942 Aug  3 12:33 httpd-default.conf
    -rw-r--r-- 1 root root   1119 Aug  3 12:33 httpd-info.conf
    -rw-r--r-- 1 root root   5078 Aug  3 12:33 httpd-languages.conf
    -rw-r--r-- 1 root root   1004 Aug  3 12:33 httpd-manual.conf
    -rw-r--r-- 1 root root   4450 Aug  3 12:33 httpd-mpm.conf
    -rw-r--r-- 1 root root   2216 Aug  3 12:33 httpd-multilang-errordoc.conf
    -rw-r--r-- 1 root root   1511 Aug  3 12:33 httpd-vhosts.conf
    -rw-r--r-- 1 root root  25852 Jul 23  2011 LICENSE
    -rw-r--r-- 1 root root    550 Jan  5  2013 NOTICE
    -rw-r--r-- 1 root root   3161 Aug  3 12:33 proxy-html.conf
    -rw-r--r-- 1 root root   5158 Feb 20  2012 README
    -rw-r--r-- 1 root root   8183 Feb 28  2007 VERSIONING
    

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat