/var/www/html我试图找到我的 Apache 配置中仍然存在对 的引用。当我运行时,apache2ctl -S它显示Main DocumentRoot: "/var/www/html",但我的虚拟主机或主 Apache 配置文件都没有指向该目录。
我尝试使用搜索所有配置文件grep -r "var/www/html" /etc/apache2/,但它什么也没返回。
我的文件中没有<Directory>该路径的条目/etc/apache2/apache2.conf(有一个/var/www,我在其下存储虚拟主机)。
这种配置怪癖困扰着我的强迫症,但我也经常在 Apache 错误日志中看到这些条目:
[Fri Jun 28 18:19:53.424619 2019] [autoindex:error] [pid 22665]
[client 209.222.82.167:47376] AH01276: Cannot serve directory
/var/www/html/: No matching DirectoryIndex
(default.php,index.php,index.html,index.htm) found, and server-generated
directory index forbidden by Options directive
Run Code Online (Sandbox Code Playgroud)
Apache 如何决定主文档根是什么,以及如何更改它?
编辑:
对于我的可用站点/已启用站点,我有四个文件:000-default.conf、000-default-le-ssl.conf、000-www-default.conf和000-www-default-le-ssl.conf。这000-default.conf是 certbot 设置的重定向,指向 https 站点,并且没有 DocumentRoot 指令。与ServerName000-www-default.conf相同 …