想把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 directivehtml
可是在URL后加上目录名能够访问浏览器
修改httpd.conf文件服务器
<Directory "/home/data">ide
Options FollowSymLinks Indexesui
AllowOverride None日志
Require all grantedserver
</Directory>htm
Indexes表明文件列表目录ip
重启httpd依然如此it
后来查看conf.d/welcome.conf文件,发现Options后边有个-Indexes,其中这个“-”号表示禁止的意思,因此这个设置的意思就是根目录“/”下不支持文件列表,自动跳转到403页面
把Indexes前面的“-”号去掉,重启服务器就能够了