我正在尝试使用mod_autoindex和FancyIndexing设置一个网站,将我的自定义标头放在目录列表上方。我遇到的问题是我的系统表现得好像我的HEADER.html不存在,无论我是告诉它使用当前目录中的那个还是像/repos/HEADER.html
这样的固定位置。
配置文件autoindex.conf有
ReadmeName README.html
HeaderName HEADER.html
在其中我也尝试将这些行添加到我的vhost的/ repo目录部分,但注意到已更改。这个设置在CentOS 6.6上使用来自CentOS的scl repo的Apache 2.4.6和PHP 5.4.16。下面是我的vhost配置的副本供参考。任何帮助或建议将不胜感激。
<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>
答案 0 :(得分:0)
事实证明,这需要mod_mime。我所要做的就是将include ::apache::mod::mime
添加到我的Puppet清单和wala中,它有效。我已经在CentOS 6 + scl的原始设置和CentOS 7上验证了这一点。