添加支持模块
主配置文件 httpd.conf 中解除注释:
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
注意一定要拥有这两个模块,否则下面的配置不生效,返回404 Not Found错误。
这个模块也有可能直接编译到Apache核心文件httpd中去了。
为目录添加Options Indexes,即可生成目录。
首先在 httpd.conf
中找到并取消该行的注释:
Include conf/extra/httpd-autoindex.conf
然后添加如下配置即可
<Directory "D:/workspace">
Options Indexes FollowSymLinks
</Directory>
Options
指令可参考