Apche是一款應用廣泛的Web服務器軟件,它可以在大多數計算機操作系統中運行,具有跨平臺性。我們在配置Apche文件時,會提示找不到匹配的DiectoyIndex(index.html)文件,那麼如何解決這個錯誤呢?下面一起來了解下。
一般在嘗試訪問具有index.php文件(或其他索引文件)但沒有index.html或其他指定的“目錄索引”文件的應用程序時,則可能會出現找不到匹配文件。
舉個簡單例子,比如phpMyAdmin在安裝時包括index.php文件,但不包括index.html文件。
默認情況下,Apche配置有以下內容:
<IfModule di_module>
DiectoyIndex index.html
</ IfModule>
這意味着Apche將僅查找名爲index.html的目錄索引文件。因此,當嘗試訪問phpMyAdmin時,Apche引發以下錯誤:
[utoindex:eo] [pid 205] [client 0.30.6.80:50800] AH0276:無法提供目錄/ us / she / phpMyAdmin /:找不到匹配的DiectoyIndex(index.html),並且服務器生成的目錄索引受Options指令禁止
想要解決以上Apche錯誤,我們可以把index.php添加到DiectoyIndex指令。
im /etc/httpd/conf/httpd.conf
把下面這個代碼進行修改。
<IfModule di_module>
DiectoyIndex index.html
</ IfModule>
以上代碼修改爲:
<IfModule di_module>
DiectoyIndex index.html index.php
</IfModule>
然後退出並使用:wq命令保存文件。
最後一定要記得重新啓動Apche:
systemctl estt httpd