Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've set up a new VirtualHost on Apache with this configuration:

DocumentRoot "/var/www/html"

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

When I access to I get the correct document root. But If I go to http://myIP it access to /var/www/html/ instead of /var/www/html

Any idea how to fix this ?


share|improve this question
up vote 1 down vote accepted

You need to set up a default virtualhost to catch unspecified requests, otherwise the one will catch those.

Here's the Apache documentation on this topic:

share|improve this answer
Thansk cjc: Ive put this in my httpd.conf <VirtualHost default:*> DocumentRoot /var/www/html </VirtualHost> But now, It shows me the /var/www/html directory when I go to – Klian Apr 18 '12 at 9:38
Are you running NameVirtualHosts ? – cjc Apr 18 '12 at 9:40

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.