Apache服务器不能访问根目录文件列表
想把Apache2.4作为文件服务器,设置好根目录后,启动httpd,打开浏览器访问httpd,直接显示forbidden,无法访问。查看日志,报错信息为AH01276: Cannot serve directory /home/data/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive但是在URL后加上目录名可以访问
修改httpd.conf文件
[*]
[*] Options FollowSymLinks Indexes
[*] AllowOverride None
[*] Require all granted
[*]
Indexes代表文件列表目录
重启httpd依然如此
后来查看conf.d/welcome.conf文件,发现Options后边有个-Indexes,其中这个“-”号表示禁止的意思,所以这个设置的意思就是根目录“/”下不支持文件列表,自动跳转到403页面
把Indexes前面的“-”号去掉,重启服务器就可以了
页:
[1]