Phabricator install. Rewrite rules are not configured correctly

自闭症网瘾萝莉.ら 提交于 2019-12-11 04:55:21

问题


I've followed the Phabricator Configuration Guide, and after installing all dependencies, I'm facing the following message:

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

This message is shown when I try to access www.cleverbit.com.br/phabricator/webroot/

I have a apache2.conf file configured just the way the docs suggested:

    <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>

What's exactly wrong with my apache rewrite configuration?


回答1:


Apache does not have inheritance inside Directory statements, so you also need the AllowOverride All line inside the Directory block for /var/www/html/phabricator/webroot.

To avoid confusion, I would get rid of the /var/www Directory block, unless you have another VirtualHost that uses it (in which case, you might want to move Phabricator out from that directory to avoid accidentally creating back doors).




回答2:


Setting the following rewrite rules fixed this for me

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

thanks to https://gist.github.com/sparrc/b4eff48a3e7af8411fc1



来源:https://stackoverflow.com/questions/49344737/phabricator-install-rewrite-rules-are-not-configured-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!