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

问题描述 投票:1回答:2

我跟着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重写配置有什么问题?

php apache apache2 phabricator
2个回答
1
投票

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

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


0
投票

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

    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

© www.soinside.com 2019 - 2024. All rights reserved.