Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am using Apache/2.4.7 to host a server. I am hosting phabricator on it. Let us say that the ip is x.x.x.x and the domain name pointing to the ip is example.com.

Following are the contents of

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

So, if I enter the ip, i.e., x.x.x.x in the address bar of the browser, phabricator opens up nice and fine. But instead if I use the domain name: example.com,

it throws up the error:

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

What mistake am I making? How do I go on about resolving it?

Thank you.

PS: I used the follwoing guide for configuring Phabricator: https://secure.phabricator.com/book/phabricator/article/configuration_guide/

PPS: Also, I'm pretty sure that example.com points correctly to x.x.x.x because using the following conf file , when I enter example.com in the address bar I see the apache default page:

<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>
like image 832
Paagalpan Avatar asked Feb 25 '16 13:02

Paagalpan


1 Answers

This link: https://secure.phabricator.com/T8717 gives me a hint that you probably need to set the config parameter phabricator.base-uri. Try:

 ./bin/config set phabricator.base-uri 'http://example.com/'
like image 75
Nehal J Wani Avatar answered Nov 04 '22 08:11

Nehal J Wani