apachevhostsmod-autoindex

mod_autoindex on Apache 2.4


I am trying to setup a site with mod_autoindex and FancyIndexing that places my custom header above the directory listing. The problem that I am running into is that my system is acting as though my HEADER.html doesn't exist regardless of whether I tell it to use the one in the current directory or one in a fixed location like /repos/HEADER.html.

The config file autoindex.conf has

ReadmeName README.html
HeaderName HEADER.html

in it and I also tried adding these lines to the /repo directory section of my vhost but noting changed. This setup is on on CentOS 6.6 using Apache 2.4.6 and PHP 5.4.16 from CentOS's scl repo. Below is a copy of my vhost config for reference. Any help or suggestions would be greatly appreciated.

<VirtualHost 10.0.2.15:8080>
  ServerName reflector.localdomain

  ## Vhost docroot
  DocumentRoot "/opt/rh/httpd24/root/var/www/html"
  ## Alias declarations for resources outside the DocumentRoot
  Alias /icons "/opt/rh/httpd24/root/usr/share/httpd/icons"

  ## Directories, there should at least be a declaration for /opt/rh/httpd24/root/var/www/html

  <Directory "/opt/rh/httpd24/root/var/www/html">
    Options FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>

  <Directory "/opt/rh/httpd24/root/var/www/html/repos">
    Options Indexes FollowSymLinks MultiViews
    IndexOptions FancyIndexing FoldersFirst IgnoreCase SuppressDescription VersionSort XHTML
    AllowOverride None
    Require all granted
    DirectoryIndex disabled
  </Directory>

  ## Logging
  ErrorLog "/var/log/httpd24/MainSite_error.log"
  ServerSignature Off
  CustomLog "/var/log/httpd24/MainSite_access.log" combined

  ## Custom fragment
  ProxyPassMatch "^/(.*\.php(/.*)?)$" "fcgi://127.0.0.1:9000/opt/rh/httpd24/root/var/www/html/$1"
</VirtualHost>

Solution

  • It turns out that mod_mime is needed for this. All I had to do was add include ::apache::mod::mime to my Puppet manifest and wala, it worked. I have verified this on the original setup of CentOS 6 + scl and on CentOS 7.