apache - 此请求在主机 "/"上请求 "example.com",但没有配置可以满足此请求的站点

标签 apache server phabricator

我使用 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 因为使用以下配置文件,当我在地址栏中输入 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>

最佳答案

此链接:https://secure.phabricator.com/T8717给我一个提示,您可能需要设置 config参数 phabricator.base-uri .尝试:

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

关于apache - 此请求在主机 "/"上请求 "example.com",但没有配置可以满足此请求的站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35628144/

相关文章:

Apache ProxyPass 和 session

python - 将我的树莓派连接到 MySQL

php - 避免 cURL 调用之间的网络问题

phabricator - 从 Phabricator 中的差异代码审查中导出评论

php - 自定义先驱行动 phabricator

apache - 在 Centos 6 上运行的 Apache 2.4.7 上安装 mod_ext_filter

javascript - app.get() 和 app.route().get() 的区别

javascript - TypeError : require(. ..).listen 不是函数

nginx - 如何将nginx请求重定向到不同的路径

java - 发送至 plc 的多个请求值无法解决的错误 (apache.plc4x)