【问题标题】:This request asked for "/" on host "example.com", but no site is configured which can serve this request此请求要求主机“example.com”上的“/”,但未配置可以服务此请求的站点
【发布时间】:2016-06-08 06:39:02
【问题描述】:

我正在使用 Apache/2.4.7 来托管服务器。我在上面托管phabricator。 假设ip为x.x.x.x,指向该ip的域名为example.com。

以下是

的内容

/etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
         ServerName http://x.x.x.x/
         DocumentRoot /home/ubuntu/phabricator/phabricator/webroot
         RewriteEngine on
         RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
         RewriteRule ^/favicon.ico   -                       [L,QSA]
         RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
        <Directory /home/ubuntu/phabricator/phabricator/webroot>
                Options Indexes FollowSymLinks Includes ExecCGI
                AllowOverride None
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


<VirtualHost *:80>
         ServerName http://example.com
         ServerAlias www.example.com
         DocumentRoot /home/ubuntu/phabricator/phabricator/webroot
         RewriteEngine on
         RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
         RewriteRule ^/favicon.ico   -                       [L,QSA]
         RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]


        <Directory /home/ubuntu/phabricator/phabricator/webroot>
                Options Indexes FollowSymLinks Includes ExecCGI
                AllowOverride None
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

所以,如果我在浏览器的地址栏中输入 ip,即 x.x.x.x,phabricator 会很好地打开。但是如果我使用域名:example.com,

它抛出错误:

This request asked for "/" on host "placire.com", but no site is configured which can serve this request.

我犯了什么错误?我该如何继续解决它?

谢谢。

PS:我使用以下指南来配置 Phabricator: https://secure.phabricator.com/book/phabricator/article/configuration_guide/

PPS:另外,我很确定 example.com 正确指向 x.x.x.x,因为使用以下 conf 文件,当我在地址栏中输入 example.com 时,我看到了 apache 默认页面:

<VirtualHost *:80>
         ServerName http://x.x.x.x
         DocumentRoot /home/ubuntu/phabricator/phabricator/webroot
         RewriteEngine on
         RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
         RewriteRule ^/favicon.ico   -                       [L,QSA]
         RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]

        <Directory /home/ubuntu/phabricator/phabricator/webroot>
                Options Indexes FollowSymLinks Includes ExecCGI
                AllowOverride None
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
         ServerName example.com
         DocumentRoot /var/www/html/

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

【问题讨论】:

    标签: apache server phabricator


    【解决方案1】:

    此链接:https://secure.phabricator.com/T8717 提示您可能需要设置config 参数phabricator.base-uri。试试:

     ./bin/config set phabricator.base-uri 'http://example.com/'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-29
      • 2014-05-18
      • 2019-09-12
      • 2019-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多