【问题标题】:"Forbidden, you don't have an access" after adding "<VirtualHost *>" to the httpd.conf file将“<VirtualHost *>”添加到 httpd.conf 文件后出现“禁止,您无权访问”
【发布时间】:2016-12-25 07:43:42
【问题描述】:

我在 Oracle Linux VM 上配置了一个 Phabricator。我已经按照 Phabricator 的官方指南完成了所有操作。一切正常 - 在浏览器中输入 ip 地址后,我可以看到一个 apache 主页。但是当我在 httpd.conf 文件的末尾添加以下行时:

<VirtualHost *>
  # Change this to the domain which points to your host.
  ServerName phabricator.example.com

  # Change this to the path where you put 'phabricator' when you checked it
  # out from GitHub when following the Installation Guide.
  #
  # Make sure you include "/webroot" at the end!
  DocumentRoot /path/to/phabricator/webroot

  RewriteEngine on
  RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
  RewriteRule ^/favicon.ico   -                       [L,QSA]
  RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
</VirtualHost>

我收到:“禁止”

您无权访问此服务器上的 /。

此外,在尝试使用 ErrorDocument 处理请求时遇到 403 Forbidden 错误。”

我做错了什么?

已解决

我去了/etc/httpd/conf.d/,找到了“welcome.conf”文件。这条线 &lt;Directory /usr/share/httpd/noindex&gt; 我改成这样: &lt;Directory /&lt;path&gt;/phabricator/webroot&gt; 别名是这样的: Alias /.noindex.html /opt/phabricator/phabricator/webroot/index.html

这对我有用。希望能帮到你

【问题讨论】:

    标签: apache httpd.conf access-denied phabricator


    【解决方案1】:

    403 Forbidden 通常“表示您的文件权限不正确”

    确保路径:/path/to/phabricator/webroot:

    • 存在
    • 具有适当的权限 755 或 644
    • (可能是可选的):归 Apache(或您拥有的任何 Apache 用户)所有

    【讨论】:

    • 我查了一下,不是这个。我已经解决了这个问题,在另一个文件中添加了一些行。但现在我忘记了它在哪里:) 当我提醒时,我会更新我的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    • 2012-02-24
    相关资源
    最近更新 更多