开启Apache目录列表:
首先找到/usr/local/apache/conf/httpd.conf 文件搜索
#Include conf/extra/httpd-autoindex.conf (去掉注释# 启用)
修改/usr/local/apache/conf/extra/httpd-autoindex.conf
注释掉:#IndexOptions FancyIndexing HTMLTable VersionSort
启用:indexOptions FancyIndexing ScanHTMLTitles NameWidth=128 DescriptionWidth=256 HTMLTable VersionSort FoldersFirst
#######################################################################
之后遇到Apache列表索引中文乱码问,在httpd-autoindex.conf文件中添加:Charset=GBK
indexOptions Charset=GBK FancyIndexing ScanHTMLTitles NameWidth=128 DescriptionWidth=256 HTMLTable VersionSort FoldersFirst
重启Apache问题解决~
虚拟主机配置处添加:
C#代码
- <Directory "/data/web_bk">
- Options Indexes FollowSymLinks
- AllowOverride All
- Order allow,deny
- Order deny,allow
- Allow from all
- </Directory>
Apache 配置显示版本信息:
C#代码
- ########### Add ##############
- AddDefaultCharset GBK
- ServerSignature On
- ########### Add ##############
- Include shost/*.conf