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

My document root (suddenly and unexpectedly) changed to /htdocs from /var/www. This happened after I restarted apache2.

The only thing I changed was the httpd.conf file which now reads as follows:

<VirtualHost *>
    ServerName hostname
    UseCanonicalName ON

I've greped through the entire /etc directory looking for DocumentRoot and they all say /var/www.

I removed the 000-default from sites-enabled and replaced it with one that is named default. Changing this back doesn't appear to have an effect.

share|improve this question
up vote 2 down vote accepted

Turns out that by adding a <VirtualHost> without a DocumentRoot it will default to the basic Apache2 DocumentRoot. Contrary to what the package (and everything else says), the source gives the DocumentRoot as /htdocs.

The solution is to add DocumentRoot: /var/www to the httpd.conf file.


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.