Apache2 仍然显示文件列表而不是我的网页(目录索引已调整)

Apache2 still shows a list of files instead of my webpage ( Directoryindex adjusted )

我最近在 AWS 使用 LAMP 和 Ajenti 启动了 ubuntu 实例。 将我的文件上传到 var/www 部分,检查了 Directoryidex(存在 index.html)。但是当我尝试访问我的网页时,它会给我一个文件列表而不是 运行 一个页面。有任何想法吗?

确保 index.html 存在于网络根目录中。当您在浏览器中看到文件列表时,请确保 index.html 存在。 (抱歉不能 post 作为评论,没有足够的代表)

确保 DocumentRootDirectoryIndexVirtualHosts and/or .htaccess 中设置正确。此外,您可能希望任何人看到您的文件树,请使用以下代码段来避免这种情况。

<Directory /path/to/your/dir>
    Options -Indexes
</Directory>