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 directivehtml

clipboard.png

可是在URL後加上目錄名能夠訪問瀏覽器

clipboard1.png

修改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頁面

clipboard2.png

把Indexes前面的「-」號去掉,重啓服務器就能夠了

clipboard3.png

相關文章
相關標籤/搜索