Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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
add comment

1 Answer 1

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.

Source: wiki.apache.org

share|improve this answer
add comment

Your Answer

 
discard

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.