【问题标题】:OSX localhost directory icons appearing as text [access_compat] [AH01797]OSX localhost 目录图标显示为文本 [access_compat] [AH01797]
【发布时间】:2017-07-25 19:29:00
【问题描述】:

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

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

[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/

【问题讨论】:

    标签: macos apache permissions


    【解决方案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
    

    这应该允许图标加载。

    【讨论】:

      猜你喜欢
      • 2014-06-23
      • 2015-12-01
      • 2015-07-09
      • 2016-09-04
      • 2018-10-15
      • 2019-12-06
      • 1970-01-01
      • 2015-11-16
      • 2017-01-18
      相关资源
      最近更新 更多