Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a ubuntu server with apache setup, the main domain on the server is a subdomain, which is working fine.

Now if I setup, then that also is displaying the web page of, the DocumentRoot for is different, still it shows the web page of how can I resolve this, so displays the pages that are there in its DocumentRoot.

share|improve this question
Can we get the httpd.conf posted in please so we can see the Vhosts – Jacob Jan 31 '11 at 4:37

1 Check active NameVirtualHost. Open /etc/apache2/ports.conf file:

NameVirtualHost *:80

2 Check DNS

# ping app.local
PING localhost.localdomain ( 56(84) bytes of data.

# ping
PING localhost.localdomain ( 56(84) bytes of data.

3 Check Apache config(/etc/apache2/sites-enabled/000-default):

<VirtualHost *:80>
        ServerName app.local
        DocumentRoot /var/www
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

<VirtualHost *:80>
        DocumentRoot /var/www/john

$ sudo apache2ctl configtest
Syntax OK

$ sudo  apache2 -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server app.local (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost app.local (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost (/etc/apache2/sites-enabled/000-default:12)

4 Test Apache:

$ curl
$ curl http://app.local
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.