Phabricator重写规则配置问题

mau*_*mau 5 apache ubuntu mod-rewrite phabricator

我在安装除颤器时遇到问题。实际上,这似乎很简单。我完全复制了示例代码。

apache2.conf:

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

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

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


<Directory "/var/www/phabricator/webroot">
  Require all granted
</Directory>
Run Code Online (Sandbox Code Playgroud)

每当我在浏览器上访问服务器IP时,都会出现此错误:

Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.
Run Code Online (Sandbox Code Playgroud)

我发现这是相位器代码的一部分:

if (!isset($_REQUEST['__path__'])) {
    self::didFatal(
        "Request parameter '__path__' is not set. Your rewrite rules ".
        "are not configured correctly.");
}
Run Code Online (Sandbox Code Playgroud)

任何人都知道如何克服这个吗?

Jor*_*ero 1

我在 Phab 上遇到了类似的问题,并通过以下方法解决了它:

  1. 将 Directory 段放置在 VirtualHost 段内。
  2. 您的系统中是否运行任何其他虚拟服务器?如果是这样,请指定端口*:80(或者尝试不同的端口,如果尝试其他端口,请记住在声明 VirtualHost 段之前添加Listen 8081
  3. 最后将目录段的内容替换为:

    Order allow,deny
    Allow from all
    
    Run Code Online (Sandbox Code Playgroud)