我使用 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/