【问题标题】:Localhost Error (403 Forbidden) with Yosemite优胜美地的 localhost 错误(403 禁止)
【发布时间】:2014-11-03 18:57:34
【问题描述】:

首先,我查看了这个页面 [Apache localhost 403 error with Yosemite,因为这个人似乎和我有同样的问题。我尝试了不同的东西,但它对我不起作用。当我在我的 url 中写 localhost 时,我收到一个403 Forbidden "You don't have permission to access / on this server"。对不起,我是初学者。我真的不知道你需要知道什么样的信息来帮助我解决这个问题。

我的目录 /Users/schan/Sites/ 我的 user.conf (schan.conf) 是

<Directory "/Users/schan/Sites/">
  Options Indexes MultiViews
  AllowOverride All
  Require all granted
</Directory>

我的 httpd.conf(如果您需要更多信息,请告诉我)

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Users/schan/Sites"
<Directory "/Users/schan/Sites">
    #
    # 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 FollowSymLinks Multiviews
    MultiviewsMatch Any

    #
    # 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

【问题讨论】:

    标签: apache httpd.conf http-status-code-403 osx-yosemite user.config


    【解决方案1】:

    如果您在 url 中写入 'localhost',则会在 yosemite 上调用以下目录:/Library/WebServer/Documents/ 这与 /Users/schan/Sites 不同 你会调用 /Users/schan/Sites 使用:

    http://localhost/~schan
    

    在我的 Yosemite 上的“localhost”上发生 403,如果我从文档文件夹中删除读取权限,它应该是 644,或者在 Finder 信息中它会说

    System    read and write
    wheel     read only
    everyone  read only
    

    对于设置本地用户,我发现此链接最有用且最完整:http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/

    【讨论】:

      猜你喜欢
      • 2014-10-04
      • 1970-01-01
      • 1970-01-01
      • 2014-12-13
      • 1970-01-01
      • 2014-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多