【发布时间】:2014-02-16 06:18:06
【问题描述】:
我在 Ubuntu 13.10 的 Apache 2.4 中遇到问题。 我尝试将 Document Root 更改为 /home/fandi/public_html 一切正常。但我尝试在我的 public_html/ 中创建文件夹我收到这样的错误:
[Sat Jan 25 10:59:50.149441 2014] [autoindex:error] [pid 1093] [client 127.0.0.1:39901] AH01276: Cannot serve directory /home/fandi/public_html/report_php/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
我必须创建文件index.html、index.php 和其他index.xxx 文件。
默认情况下它必须显示目录索引。 如何启用目录索引?
这是我的文件000-default.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/fandi/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/home/fandi/public_html">
Options All
AllowOverride All
Require all granted
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
请帮忙,谢谢之前^^
【问题讨论】:
-
不知道为什么这被标记为 php 或 ubuntu - 这是一个纯粹的 Apache 问题
-
如何使用 Apache DirectoryIndex 指令amitoverflow.com/2021/04/29/how-to-use-directoryindex