【问题标题】:Phabricator install. Rewrite rules are not configured correctly安装Phabricator。重写规则配置不正确
【发布时间】:2018-03-18 05:27:07
【问题描述】:

我关注了 Phabricator Configuration Guide,在安装了所有依赖项后,我面临以下消息:

Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.

当我尝试访问www.cleverbit.com.br/phabricator/webroot/时显示此消息

我按照文档建议的方式配置了一个 apache2.conf 文件:

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

  # 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 /var/www/html/phabricator/webroot

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

<Directory />
        Options FollowSymLinks
        AllowOverride All
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride All
        Require all granted
</Directory>

<Directory "/var/www/html/phabricator/webroot">
        Require all granted
        AllowOverride All
</Directory>

我的 apache 重写配置到底出了什么问题?

【问题讨论】:

  • 您安装的操作系统是什么?
  • 这是一个 Ubuntu 16.04

标签: php apache apache2 phabricator


【解决方案1】:

Apache 在 Directory 语句中没有继承,因此您还需要在 Directory 块中为 /var/www/html/phabricator/webroot 设置 AllowOverride All 行。

为避免混淆,我会删除/var/www Directory 块,除非您有另一个使用它的 VirtualHost(在这种情况下,您可能希望将 Phabricator 从该目录中移出以避免意外创建后门)。

【讨论】:

  • 我按照你的建议做了:同样的问题:(我用新的 apache2.conf 编辑了我的问题
  • 如果我转到cleverbit.com.br,我会看到一条关于 PHP 7.0 不受支持的消息。您需要使用 PHP 7.1 或更高版本(5.x 以前也可以,但我不知道是否仍然如此)
  • 实际上,现在我有一个“[Core Exception/Exception] Define 'phabricator.base-uri' in your configuration to continue。”。由于这不是问题的主要主题,我会给你赏金。 @JSON 你现在知道这是什么问题了吗?:
  • 如果你使用 http,你需要明确设置 phabricator.base-uri,因为默认是使用 https(你应该考虑 -letsencrypt 是免费且易于设置的)。您可以从命令行执行此操作:/var/www/html/phabricator/bin/config set phabricator.base-uri "http://www.cleverbit.com.br/"
【解决方案2】:

设置以下重写规则为我解决了这个问题

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

感谢https://gist.github.com/sparrc/b4eff48a3e7af8411fc1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-11
    • 1970-01-01
    • 2021-05-04
    • 2013-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多