Phabricator 安装。重写规则配置不正确

Phabricator install. Rewrite rules are not configured correctly

我已关注 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__=  [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 重写配置究竟有什么问题?

Apache 在 Directory 语句中没有继承,因此您还需要 /var/www/html/phabricator/webroot.

的 Directory 块中的 AllowOverride All

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

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

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

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