OSX localhost目录图标显示为文本[access_compat] [AH01797]

时间:2017-03-06 03:14:36

标签: macos apache permissions

这个问题似乎是在我更新到Sierra后出现的。在检查显示为localhost/icons/text.gif的图片时,我创建了一个文件夹并将其分配为777,但仍面临同样的问题。

每次查看应显示图标的页面时,apache错误日志都会收到以下垃圾邮件。 /usr/share/httpd/icons/由root拥有drwxr-xr-x权限。

[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/unknown.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/text.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/folder.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/compressed.gif, referer: http://localhost/testing/

Local folder icons

1 个答案:

答案 0 :(得分:1)

如果使用以下命令打开Apache配置文件:

sudo nano /private/etc/apache2/httpd.conf

然后输入以下代码(您可以将其放在其他目录代码旁边):

<Directory /usr/share/httpd/icons>
        Allow from all
</Directory>

使用ctrl-O保存文件,然后使用ctrl-X关闭文件并使用以下命令重新启动apache:

sudo apachectl restart

应该允许图标加载。