如何修复403 Forbidden / access denied because search permissions on Apache on MacOs Ventura

6qftjkof  于 2023-10-23  发布在  Apache
关注(0)|答案(1)|浏览(191)

最近,我在运行MacOs Ventura的机器上使用brew安装了Apache / PHP。它工作了几天,直到我不得不重新启动机器。
现在,当我尝试导航到localhost时,我得到403 Forbidden,Apache错误日志显示了很多这样的行:

[Wed Aug 02 10:10:06.198965 2023] [core:error] [pid 337] (13)Permission denied: [client ::1:51255] AH00035: access to /favicon.ico denied (filesystem path '/Users/admin/Library') because search permissions are missing on a component of the path, referer: http://localhost/

以下是我已经尝试过但没有运气的事情:
1 -使用brew服务重新启动Apache重新启动httpd
2 -取消我的www文件夹权限,它是'读和写'给每个人。
3 -尝试在MacOs上将我的www文件夹标记为“共享文件夹”
3 -检查了我的www文件夹的httpd.conf设置,它是这样的:

DocumentRoot "/Users/admin/Library/Mobile Documents/com~apple~CloudDocs/www"
<Directory "/Users/admin/Library/Mobile Documents/com~apple~CloudDocs/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

我还应该寻找什么?

eimct9ow

eimct9ow1#

在与这个问题斗争了几天之后,我发现我所需要的就是使用sudo启动httpd:

sudo brew services restart httpd

我的猜测是,因为我的www文件夹在我的icloud文件夹中,它需要管理员权限。

相关问题